From ff61170a88ac30fb30afda4df03b763e20d4a7d7 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 11:12:37 +0000 Subject: [PATCH 01/17] Update dependency installation in GitHub Actions workflow --- .github/workflows/python.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 419e118c1..e46aea1f3 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -29,7 +29,9 @@ jobs: - name: Set up dependencies run: | python -m pip install --upgrade pip - pip install setuptools build cython pytest pytest-skip-slow wheel lxml numpy scipy nbformat nbclient ipykernel + pip install setuptools build cython wheel + pip install -r tests/requirements.txt + pip install -r doc/requirements.txt - name: Build source distribution run: python -m build From c05dfb8676af13c32f22c510827071d66898c1d1 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 11:18:04 +0000 Subject: [PATCH 02/17] Refactor GitHub Actions to simplify test execution and skip notebooks on Python < 3.12 --- .github/workflows/python.yml | 8 +------- tests/test_tutorials.py | 5 +++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index e46aea1f3..18acea48a 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -40,13 +40,7 @@ jobs: cd dist pip install -v pygambit*.tar.gz - name: Run tests - run: | - if [ "${{ matrix.python-version }}" = "3.9" ]; then - # Python 3.9 on linux skips the notebook execution test (notebooks may require newer kernels/deps) - pytest -q -k 'not test_execute_notebook' - else - pytest - fi + run: pytest macos-13: runs-on: macos-13 diff --git a/tests/test_tutorials.py b/tests/test_tutorials.py index f6f3f2123..7f3c95c8a 100644 --- a/tests/test_tutorials.py +++ b/tests/test_tutorials.py @@ -1,5 +1,6 @@ import contextlib import os +import sys from pathlib import Path import nbformat @@ -45,6 +46,10 @@ def test_execute_notebook(nb_path): This uses nbclient.NotebookClient to run the notebook in its parent directory so relative paths within the notebook resolve correctly. """ + # Skip notebook execution tests on Python < 3.12 (notebooks may require newer kernels/deps) + if sys.version_info < (3, 12): + pytest.skip("Notebook execution tests require Python 3.12 or newer") + nb = nbformat.read(str(nb_path), as_version=4) # Prefer the notebook's kernelspec if provided, otherwise let nbclient pick the default. From 035c2fc9d11097905420770bdc06f98de6c5d323 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 11:22:05 +0000 Subject: [PATCH 03/17] Skip installing documentation requirements for Python 3.9 in GitHub Actions --- .github/workflows/python.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 18acea48a..8fb335273 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -31,7 +31,9 @@ jobs: python -m pip install --upgrade pip pip install setuptools build cython wheel pip install -r tests/requirements.txt - pip install -r doc/requirements.txt + if [ "${{ matrix.python-version }}" != "3.9" ]; then + pip install -r doc/requirements.txt + fi - name: Build source distribution run: python -m build From 50174c683b7ca26da64be1fa87698a1fd1756639 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 11:24:30 +0000 Subject: [PATCH 04/17] Revert "Skip installing documentation requirements for Python 3.9 in GitHub Actions" This reverts commit 035c2fc9d11097905420770bdc06f98de6c5d323. --- .github/workflows/python.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 8fb335273..18acea48a 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -31,9 +31,7 @@ jobs: python -m pip install --upgrade pip pip install setuptools build cython wheel pip install -r tests/requirements.txt - if [ "${{ matrix.python-version }}" != "3.9" ]; then - pip install -r doc/requirements.txt - fi + pip install -r doc/requirements.txt - name: Build source distribution run: python -m build From f0ee6b39aaa4b187921f6602a2703cd0b2f2f603 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 11:26:53 +0000 Subject: [PATCH 05/17] weaken pytest version constraint --- tests/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/requirements.txt b/tests/requirements.txt index 2091c7fde..ab217b4bb 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,4 @@ -pytest==9.0.0 +pytest nbformat==5.10.4 nbclient==0.10.2 ipykernel==6.30.1 From 03c1cd3eba437e6ab7a8aefcfb12e08868890535 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 11:38:49 +0000 Subject: [PATCH 06/17] remove most package version pinning in requirements files --- doc/requirements.txt | 22 +++++++++++----------- tests/requirements.txt | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index b06d80877..81b2967d1 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,12 +1,12 @@ -Cython==3.1.2 -numpy==2.3.2 -scipy==1.16.1 -pydata-sphinx-theme==0.16.1 -sphinx_design==0.6.1 -sphinx-autobuild==2024.10.3 -nbsphinx==0.9.7 -ipython==9.4.0 -matplotlib==3.10.5 -pickleshare==0.7.5 -jupyter==1.1.1 +Cython +numpy +scipy +pydata-sphinx-theme +sphinx_design +sphinx-autobuild +nbsphinx +ipython +matplotlib +pickleshare +jupyter open_spiel==1.6.9 diff --git a/tests/requirements.txt b/tests/requirements.txt index ab217b4bb..545fd9b00 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,4 @@ pytest -nbformat==5.10.4 -nbclient==0.10.2 -ipykernel==6.30.1 +nbformat +nbclient +ipykernel From 19950611849295bc27566f9a3d30ce55774f682e Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 11:40:33 +0000 Subject: [PATCH 07/17] remove version pinning for open_spiel in requirements.txt --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 81b2967d1..606f56fbd 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -9,4 +9,4 @@ ipython matplotlib pickleshare jupyter -open_spiel==1.6.9 +open_spiel From 039049326da70a9518ac74b07248fef70846e797 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 11:42:10 +0000 Subject: [PATCH 08/17] remove Cython from doc requirements since it is already installed as a gambit build dependency --- doc/requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 606f56fbd..56295261f 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,4 +1,3 @@ -Cython numpy scipy pydata-sphinx-theme From a54d99fcf7c0c3ef55f723834a2f5b7712c92fb8 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 11:50:41 +0000 Subject: [PATCH 09/17] Revert "remove Cython from doc requirements since it is already installed as a gambit build dependency" This reverts commit 039049326da70a9518ac74b07248fef70846e797. --- doc/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/requirements.txt b/doc/requirements.txt index 56295261f..606f56fbd 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -1,3 +1,4 @@ +Cython numpy scipy pydata-sphinx-theme From 0953adb949284d0a8e9b970b2fb9d90fb75aaeac Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 11:57:35 +0000 Subject: [PATCH 10/17] temporarily remove path ignores to run tests on all PRs --- .github/workflows/python.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 18acea48a..609ba6d2b 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -7,10 +7,6 @@ on: - '.github/ISSUE_TEMPLATE/**' - 'README.md' pull_request: - paths-ignore: - - 'doc/**' - - '.github/ISSUE_TEMPLATE/**' - - 'README.md' jobs: linux: From 4af7bae9d6e48778059fb063e5793a1276cb4ad8 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 12:06:21 +0000 Subject: [PATCH 11/17] remove paths-ignore from workflow files to ensure all changes trigger CI checks --- .github/workflows/lint.yml | 8 -------- .github/workflows/osxbinary.yml | 4 ---- .github/workflows/python.yml | 4 ---- .github/workflows/tools.yml | 8 -------- .github/workflows/wheels.yml | 4 ---- 5 files changed, 28 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 86de9a17d..17ec52a78 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,15 +2,7 @@ name: Linters and coding standards checks on: push: - paths-ignore: - - 'doc/**' - - '.github/ISSUE_TEMPLATE/**' - - 'README.md' pull_request: - paths-ignore: - - 'doc/**' - - '.github/ISSUE_TEMPLATE/**' - - 'README.md' jobs: clang-format: diff --git a/.github/workflows/osxbinary.yml b/.github/workflows/osxbinary.yml index 025da0132..80ac080df 100644 --- a/.github/workflows/osxbinary.yml +++ b/.github/workflows/osxbinary.yml @@ -2,10 +2,6 @@ name: MacOS static GUI binary on: push: - paths-ignore: - - 'doc/**' - - '.github/ISSUE_TEMPLATE/**' - - 'README.md' tags: - 'v*' schedule: diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 609ba6d2b..1d388306f 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -2,10 +2,6 @@ name: pygambit Python extension on: push: - paths-ignore: - - 'doc/**' - - '.github/ISSUE_TEMPLATE/**' - - 'README.md' pull_request: jobs: diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 4cd26bc61..1156547ca 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -2,15 +2,7 @@ name: Build executables on: push: - paths-ignore: - - 'doc/**' - - '.github/ISSUE_TEMPLATE/**' - - 'README.md' pull_request: - paths-ignore: - - 'doc/**' - - '.github/ISSUE_TEMPLATE/**' - - 'README.md' jobs: linux: diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7a128e639..e527dcb9b 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -3,10 +3,6 @@ name: pygambit wheels on: push: - paths-ignore: - - 'doc/**' - - '.github/ISSUE_TEMPLATE/**' - - 'README.md' tags: - 'v*' schedule: From 04dbbaec8380cd24bb7617896763b96ef7a9c55a Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 12:12:08 +0000 Subject: [PATCH 12/17] improve spacing to satisfy pre-commit hook --- .github/ISSUE_TEMPLATE/tutorial_request.yml | 2 +- .gitignore | 2 +- tests/test_tutorials.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/tutorial_request.yml b/.github/ISSUE_TEMPLATE/tutorial_request.yml index 6f8fe4513..16542ce82 100644 --- a/.github/ISSUE_TEMPLATE/tutorial_request.yml +++ b/.github/ISSUE_TEMPLATE/tutorial_request.yml @@ -32,4 +32,4 @@ body: description: Add links to any research papers or other resources the author will need to write this tutorial. value: "`[Markdown link text](url)`" validations: - required: false \ No newline at end of file + required: false diff --git a/.gitignore b/.gitignore index 4ca5ddd3c..5e3055af4 100644 --- a/.gitignore +++ b/.gitignore @@ -44,4 +44,4 @@ Gambit.app/* doc/tutorials/games/*.nfg doc/tutorials/games/*.efg *.dmg -Gambit.app/* \ No newline at end of file +Gambit.app/* diff --git a/tests/test_tutorials.py b/tests/test_tutorials.py index 7f3c95c8a..c24cc48aa 100644 --- a/tests/test_tutorials.py +++ b/tests/test_tutorials.py @@ -49,7 +49,7 @@ def test_execute_notebook(nb_path): # Skip notebook execution tests on Python < 3.12 (notebooks may require newer kernels/deps) if sys.version_info < (3, 12): pytest.skip("Notebook execution tests require Python 3.12 or newer") - + nb = nbformat.read(str(nb_path), as_version=4) # Prefer the notebook's kernelspec if provided, otherwise let nbclient pick the default. From 1cc57abfde3998300695e720d3d97d26b6f6cd7b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 13:34:17 +0000 Subject: [PATCH 13/17] install requirements consistently across workflows --- .github/workflows/python.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 1d388306f..2549c9bf4 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -50,7 +50,9 @@ jobs: - name: Set up dependencies run: | python -m pip install --upgrade pip - pip install cython pytest pytest-skip-slow wheel lxml numpy scipy nbformat nbclient ipykernel + pip install setuptools build cython wheel + pip install -r tests/requirements.txt + pip install -r doc/requirements.txt - name: Build extension run: | python -m pip install -v . @@ -73,7 +75,9 @@ jobs: - name: Set up dependencies run: | python -m pip install --upgrade pip - pip install cython pytest pytest-skip-slow wheel lxml numpy scipy nbformat nbclient ipykernel + pip install setuptools build cython wheel + pip install -r tests/requirements.txt + pip install -r doc/requirements.txt - name: Build extension run: | python -m pip install -v . @@ -96,7 +100,9 @@ jobs: - name: Set up dependencies run: | python -m pip install --upgrade pip - pip install cython pytest pytest-skip-slow wheel lxml numpy scipy nbformat nbclient ipykernel + pip install setuptools build cython wheel + pip install -r tests/requirements.txt + pip install -r doc/requirements.txt - name: Build extension run: | python -m pip install -v . From 70de66c1756ecf79c6d162edbe8ce1a5bd0a1eb1 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 15:55:37 +0000 Subject: [PATCH 14/17] update running tutorials locally page --- doc/tutorials/running_locally.rst | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/tutorials/running_locally.rst b/doc/tutorials/running_locally.rst index 756ae7056..656b2dd15 100644 --- a/doc/tutorials/running_locally.rst +++ b/doc/tutorials/running_locally.rst @@ -3,19 +3,27 @@ How to run PyGambit tutorials on your computer ============================================== -The PyGambit tutorials are available as Jupyter notebooks and can be run interactively using any program that supports Jupyter notebooks, such as JupyterLab or VSCode. -You will need a working installation of Python 3.9+ on your machine to run PyGambit (however the tutorials contain some syntax that may not be compatible with earlier versions of Python than 3.13). +Running the PyGambit tutorials on your machine requires some familiarity with the basics of Python and how to use Git & GitHub. +The tutorials are available as Jupyter notebooks and can be run interactively using any program that supports Jupyter notebooks, such as JupyterLab or VSCode. + +.. tip:: Create a virtual environment with Python 3.13 or higher 1. To download the tutorials, open your OS's command prompt and clone the Gambit repository from GitHub, then navigate to the tutorials directory: :: git clone https://github.com/gambitproject/gambit.git - cd gambit/doc -2. Install `pygambit` and other requirements (including `JupyterLab` and other packages used by the tutorials). We recommend creating a new virtual environment and installing both the requirements there. e.g. :: +2. Install the latest release of `pygambit` from PyPI :: - python -m venv pygambit-env - source pygambit-env/bin/activate pip install pygambit + + .. note:: + Alternatively, to install the latest development version of `pygambit`, run :: + + pip install . + +2. Install `pygambit` and other requirements (including `JupyterLab` and other packages used by the tutorials) :: + + cd gambit/doc pip install -r requirements.txt 3. Open `JupyterLab` and click on any of the tutorial notebooks (files ending in `.ipynb`) :: From c48bf0bd8a10f9b633101bc4282f1f5d6ec30c04 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 16:08:45 +0000 Subject: [PATCH 15/17] refactor tutorial installation instructions for clarity and consistency --- doc/tutorials/running_locally.rst | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/doc/tutorials/running_locally.rst b/doc/tutorials/running_locally.rst index 656b2dd15..b6be22678 100644 --- a/doc/tutorials/running_locally.rst +++ b/doc/tutorials/running_locally.rst @@ -12,21 +12,25 @@ The tutorials are available as Jupyter notebooks and can be run interactively us git clone https://github.com/gambitproject/gambit.git -2. Install the latest release of `pygambit` from PyPI :: +2. Install `pygambit`: - pip install pygambit + * To install the latest release from PyPI:: - .. note:: - Alternatively, to install the latest development version of `pygambit`, run :: + pip install pygambit - pip install . + * Alternatively, to install the latest development version:: -2. Install `pygambit` and other requirements (including `JupyterLab` and other packages used by the tutorials) :: + pip install . + +3. Install `pygambit` and other requirements (including `JupyterLab` and other packages used by the tutorials) :: cd gambit/doc pip install -r requirements.txt -3. Open `JupyterLab` and click on any of the tutorial notebooks (files ending in `.ipynb`) :: +.. warning:: + Windows users will encounter an error when installing the requirements, which include the OpenSpiel library. Users wishing to run the OpenSpiel tutorial will need to install this manually; see the `OpenSpiel installation instructions `_ for details. + +4. Open `JupyterLab` and click on any of the tutorial notebooks (files ending in `.ipynb`) :: cd tutorials jupyter lab From 5c58529a6a1a65534e1bed3d857f2f54818629c7 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 16:10:56 +0000 Subject: [PATCH 16/17] furthe tidying of instructions for running tutorials locally --- doc/tutorials/running_locally.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/tutorials/running_locally.rst b/doc/tutorials/running_locally.rst index b6be22678..8046ddcaa 100644 --- a/doc/tutorials/running_locally.rst +++ b/doc/tutorials/running_locally.rst @@ -22,13 +22,13 @@ The tutorials are available as Jupyter notebooks and can be run interactively us pip install . -3. Install `pygambit` and other requirements (including `JupyterLab` and other packages used by the tutorials) :: +3. Install other requirements (including `JupyterLab`) used by the tutorials :: cd gambit/doc pip install -r requirements.txt -.. warning:: - Windows users will encounter an error when installing the requirements, which include the OpenSpiel library. Users wishing to run the OpenSpiel tutorial will need to install this manually; see the `OpenSpiel installation instructions `_ for details. + .. warning:: + Windows users will encounter an error when installing the requirements, which include the OpenSpiel library. Users wishing to run the OpenSpiel tutorial will need to install this manually; see the `OpenSpiel installation instructions `_ for details. 4. Open `JupyterLab` and click on any of the tutorial notebooks (files ending in `.ipynb`) :: From 861e2c818716824cfce7be8952ffd6378e79d09d Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Tue, 2 Dec 2025 16:24:42 +0000 Subject: [PATCH 17/17] skip openspiel notebook test on Windows GH action and add minimal dependencies for other tutorials --- .github/workflows/python.yml | 2 +- tests/test_tutorials.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 2549c9bf4..794340dde 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -102,7 +102,7 @@ jobs: python -m pip install --upgrade pip pip install setuptools build cython wheel pip install -r tests/requirements.txt - pip install -r doc/requirements.txt + pip install nbformat nbclient ipykernel jupyter matplotlib - name: Build extension run: | python -m pip install -v . diff --git a/tests/test_tutorials.py b/tests/test_tutorials.py index c24cc48aa..4d7ed8417 100644 --- a/tests/test_tutorials.py +++ b/tests/test_tutorials.py @@ -50,6 +50,11 @@ def test_execute_notebook(nb_path): if sys.version_info < (3, 12): pytest.skip("Notebook execution tests require Python 3.12 or newer") + # Skip OpenSpiel notebook on Windows + # (OpenSpiel is not available on Windows without manual install) + if sys.platform == "win32" and "openspiel" in nb_path.name.lower(): + pytest.skip("OpenSpiel notebook requires OpenSpiel, which is not available on Windows") + nb = nbformat.read(str(nb_path), as_version=4) # Prefer the notebook's kernelspec if provided, otherwise let nbclient pick the default.