Skip to content

Commit fb1cd9b

Browse files
committed
Merge branch 'master' into issue_756
2 parents 6c2ec23 + 4c9c461 commit fb1cd9b

File tree

78 files changed

+8816
-9786
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+8816
-9786
lines changed

.github/workflows/python.yml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,15 @@ jobs:
2121
- name: Set up dependencies
2222
run: |
2323
python -m pip install --upgrade pip
24-
pip install setuptools build cython wheel
25-
pip install -r tests/requirements.txt
26-
pip install -r doc/requirements.txt
24+
python -m pip install build
2725
- name: Build source distribution
2826
run:
2927
python -m build
3028
- name: Build from source distribution
3129
run: |
3230
cd dist
33-
pip install -v pygambit*.tar.gz
31+
sdist=$(ls pygambit-*.tar.gz)
32+
pip install -v "${sdist}[test,doc]"
3433
- name: Run tests
3534
run: pytest --run-tutorials
3635

@@ -50,12 +49,9 @@ jobs:
5049
- name: Set up dependencies
5150
run: |
5251
python -m pip install --upgrade pip
53-
pip install setuptools build cython wheel
54-
pip install -r tests/requirements.txt
55-
pip install -r doc/requirements.txt
5652
- name: Build extension
5753
run: |
58-
python -m pip install -v .
54+
python -m pip install -v .[test,doc]
5955
- name: Run tests
6056
run: pytest --run-tutorials
6157

@@ -75,12 +71,9 @@ jobs:
7571
- name: Set up dependencies
7672
run: |
7773
python -m pip install --upgrade pip
78-
pip install setuptools build cython wheel
79-
pip install -r tests/requirements.txt
80-
pip install -r doc/requirements.txt
8174
- name: Build extension
8275
run: |
83-
python -m pip install -v .
76+
python -m pip install -v .[test,doc]
8477
- name: Run tests
8578
run: pytest --run-tutorials
8679

@@ -100,11 +93,8 @@ jobs:
10093
- name: Set up dependencies
10194
run: |
10295
python -m pip install --upgrade pip
103-
pip install setuptools build cython wheel
104-
pip install -r tests/requirements.txt
105-
pip install -r doc/requirements.txt
10696
- name: Build extension
10797
run: |
108-
python -m pip install -v .
98+
python -m pip install -v .[test,doc]
10999
- name: Run tests
110100
run: pytest --run-tutorials

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ Gambit.app/*
5050
*.ef
5151
build_support/msw/gambit.wxs
5252
build_support/osx/Info.plist
53+
src/pygambit/catalog
54+
doc/catalog.csv

.readthedocs.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ build:
1313
- libgmp-dev
1414
- pandoc
1515
- texlive-full
16+
jobs:
17+
# Create CSV for catalog table in docs
18+
post_install:
19+
- $READTHEDOCS_VIRTUALENV_PATH/bin/python build_support/catalog/update.py
1620

1721
python:
1822
install:
19-
- requirements: doc/requirements.txt
20-
- method: setuptools
23+
- method: pip
2124
path: "."
25+
extra_requirements:
26+
- doc

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
recursive-include src/core *.cc *.h *.imp
22
recursive-include src/games *.cc *.h *.imp
33
recursive-include src/solvers *.c *.cc *.h *.imp
4+
recursive-include catalog *
45
include src/gambit.h
56
include src/pygambit/*.pxd
67
include src/pygambit/*.pyx

Makefile.am

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ EXTRA_DIST = \
101101
src/gui/bitmaps/zoom1.xpm \
102102
src/gui/bitmaps/gambitrc.rc \
103103
contrib/games/2s2x2x2.efg \
104-
contrib/games/2smp.efg \
105104
contrib/games/2x2x2.efg \
106105
contrib/games/4cards.efg \
107106
contrib/games/artist1.efg \
@@ -132,9 +131,6 @@ EXTRA_DIST = \
132131
contrib/games/coord4.efg \
133132
contrib/games/cross.efg \
134133
contrib/games/cs.efg \
135-
contrib/games/e01.efg \
136-
contrib/games/e02.efg \
137-
contrib/games/e03.efg \
138134
contrib/games/e04.efg \
139135
contrib/games/e05.efg \
140136
contrib/games/e06.efg \
@@ -213,8 +209,6 @@ EXTRA_DIST = \
213209
contrib/games/csg4.nfg \
214210
contrib/games/deg1.nfg \
215211
contrib/games/deg2.nfg \
216-
contrib/games/e01.nfg \
217-
contrib/games/e02.nfg \
218212
contrib/games/e04.nfg \
219213
contrib/games/e07.nfg \
220214
contrib/games/g1.nfg \
@@ -240,7 +234,12 @@ EXTRA_DIST = \
240234
contrib/games/winkels.nfg \
241235
contrib/games/yamamoto.nfg \
242236
contrib/games/zero.nfg \
243-
src/README.rst
237+
src/README.rst \
238+
catalog/2smp.efg \
239+
catalog/myerson1991/fig4_2.efg \
240+
catalog/selten1975/fig1.efg \
241+
catalog/selten1975/fig2.efg \
242+
catalog/selten1975/fig3.efg
244243

245244
core_SOURCES = \
246245
src/core/core.h \

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010

1111
**Gambit** is the package for doing computation in (non-cooperative) game theory.
1212

13-
- See our [documentation](https://gambitproject.readthedocs.io/)
14-
- Check our [project website](https://www.gambit-project.org/)
13+
- **Documentation:** for the package is hosted at [gambitproject.readthedocs.io](https://gambitproject.readthedocs.io/).
14+
- **The Gambit project:** Find out more about the project at [gambit-project.org](https://www.gambit-project.org/)
15+
- **Contributors:** Please read the [code of conduct and contribution guidelines](https://gambitproject.readthedocs.io/en/latest/developer.contributing.html) before posting on GitHub.
1516

1617
Gambit provides:
1718

build_support/catalog/update.py

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
import argparse
2+
from pathlib import Path
3+
4+
import pygambit as gbt
5+
6+
CATALOG_CSV = Path(__file__).parent.parent.parent / "doc" / "catalog.csv"
7+
CATALOG_DIR = Path(__file__).parent.parent.parent / "catalog"
8+
MAKEFILE_AM = Path(__file__).parent.parent.parent / "Makefile.am"
9+
10+
11+
def update_makefile():
12+
"""Update the Makefile.am with all games from the catalog."""
13+
14+
# Using rglob("*") to find files in all subdirectories
15+
slugs = []
16+
for resource_path in sorted(CATALOG_DIR.rglob("*.efg")):
17+
if resource_path.is_file():
18+
rel_path = resource_path.relative_to(CATALOG_DIR)
19+
slugs.append(str(rel_path))
20+
for resource_path in sorted(CATALOG_DIR.rglob("*.nfg")):
21+
if resource_path.is_file():
22+
rel_path = resource_path.relative_to(CATALOG_DIR)
23+
slugs.append(str(rel_path))
24+
25+
game_files = []
26+
for slug in slugs:
27+
game_files.append(f"catalog/{slug}")
28+
game_files.sort()
29+
30+
with open(MAKEFILE_AM, encoding="utf-8") as f:
31+
content = f.readlines()
32+
33+
with open(MAKEFILE_AM, "w", encoding="utf-8") as f:
34+
in_gamefiles_section = False
35+
for line in content:
36+
# Add to the EXTRA_DIST after the README.rst line
37+
if line.startswith(" src/README.rst \\"):
38+
in_gamefiles_section = True
39+
f.write(" src/README.rst \\\n")
40+
for gf in game_files:
41+
if gf == game_files[-1]:
42+
f.write(f"\t{gf}\n")
43+
else:
44+
f.write(f"\t{gf} \\\n")
45+
f.write("\n")
46+
elif in_gamefiles_section:
47+
if line.strip() == "":
48+
in_gamefiles_section = False
49+
continue # Skip old gamefiles lines
50+
else:
51+
f.write(line)
52+
53+
with open(MAKEFILE_AM, encoding="utf-8") as f:
54+
updated_content = f.readlines()
55+
56+
if content != updated_content:
57+
print(f"Updated {str(MAKEFILE_AM)}")
58+
else:
59+
print(f"No changes to add to {str(MAKEFILE_AM)}")
60+
61+
62+
if __name__ == "__main__":
63+
64+
parser = argparse.ArgumentParser()
65+
parser.add_argument("--build", action="store_true")
66+
args = parser.parse_args()
67+
68+
# Create CSV used by RST docs page
69+
gbt.catalog.games().to_csv(CATALOG_CSV, index=False)
70+
print(f"Generated {CATALOG_CSV} for use in local docs build. DO NOT COMMIT.")
71+
72+
# Update the Makefile.am with the current list of catalog files
73+
if args.build:
74+
update_makefile()

build_support/osx/Info.plist.in

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
3-
<plist version="0.9">
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
44
<dict>
55
<key>CFBundleInfoDictionaryVersion</key>
66
<string>6.0</string>
77
<key>CFBundleIdentifier</key>
88
<string>org.gambit-project.gambit</string>
99
<key>CFBundleDevelopmentRegion</key>
10-
<string>English</string>
10+
<string>en</string>
1111
<key>CFBundleExecutable</key>
1212
<string>gambit</string>
1313
<key>CFBundleIconFile</key>
1414
<string>gambit</string>
1515
<key>CFBundleName</key>
1616
<string>Gambit</string>
17+
<key>CFBundleDisplayName</key>
18+
<string>Gambit</string>
1719
<key>CFBundlePackageType</key>
1820
<string>APPL</string>
19-
<key>CFBundleSignature</key>
20-
<string>????</string>
2121
<key>CFBundleVersion</key>
2222
<string>@GAMBIT_VERSION@</string>
2323
<key>CFBundleShortVersionString</key>
2424
<string>@GAMBIT_VERSION@</string>
2525
<key>CFBundleGetInfoString</key>
26-
<string>Gambit version @GAMBIT_VERSION@, (c) 1994-2025 The Gambit Project</string>
27-
<key>CFBundleLongVersionString</key>
28-
<string>@GAMBIT_VERSION@, (c) 1994-2025 The Gambit Project</string>
26+
<string>Gambit version @GAMBIT_VERSION@, (c) 1994-2026 The Gambit Project</string>
2927
<key>NSHumanReadableCopyright</key>
30-
<string>Copyright 1994-2025 The Gambit Project</string>
31-
<key>LSRequiresCarbon</key>
32-
<true/>
33-
<key>CSResourcesFileMapped</key>
34-
<true/>
28+
<string>Copyright 1994-2026 The Gambit Project</string>
3529
<key>CFBundleDocumentTypes</key>
3630
<array>
3731
<dict>

build_support/osx/gambit.icns

137 KB
Binary file not shown.
File renamed without changes.

0 commit comments

Comments
 (0)