From 760af77bb31e82b5407f6b022d2a7937c87d1939 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:08:18 +0000 Subject: [PATCH 01/11] update python.yml from #661 --- .github/workflows/python.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 794340dde..cac1634b3 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -10,7 +10,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.9', '3.13'] + python-version: ['3.10', '3.13'] steps: - uses: actions/checkout@v5 @@ -32,7 +32,7 @@ jobs: cd dist pip install -v pygambit*.tar.gz - name: Run tests - run: pytest + run: pytest --run-tutorials macos-13: runs-on: macos-13 @@ -57,7 +57,7 @@ jobs: run: | python -m pip install -v . - name: Run tests - run: pytest + run: pytest --run-tutorials macos-14: runs-on: macos-14 @@ -82,7 +82,7 @@ jobs: run: | python -m pip install -v . - name: Run tests - run: pytest + run: pytest --run-tutorials windows: runs-on: windows-latest @@ -102,9 +102,9 @@ jobs: python -m pip install --upgrade pip pip install setuptools build cython wheel pip install -r tests/requirements.txt - pip install nbformat nbclient ipykernel jupyter matplotlib + pip install -r doc/requirements.txt - name: Build extension run: | python -m pip install -v . - name: Run tests - run: pytest + run: pytest --run-tutorials From 8975f5bbc87987888f0d371ba0886d3a671eca26 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:09:37 +0000 Subject: [PATCH 02/11] ingore open_spiel on windows --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 606f56fbd..1bb9e99fa 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -9,4 +9,4 @@ ipython matplotlib pickleshare jupyter -open_spiel +open_spiel; sys_platform != 'win32' From 30946af3a405d297e1a126611906aa5028cc3772 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:10:24 +0000 Subject: [PATCH 03/11] add conftest.py from #661 --- tests/conftest.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/conftest.py diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 000000000..4e2b72fbd --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,27 @@ +import pytest + + +def pytest_addoption(parser): + parser.addoption( + "--run-tutorials", + action="store_true", + default=False, + help="Run tutorial notebook tests", + ) + + +def pytest_configure(config): + config.addinivalue_line( + "markers", "tutorials: mark test as a tutorial notebook test" + ) + + +def pytest_collection_modifyitems(config, items): + if config.getoption("--run-tutorials"): + # --run-tutorials given in cli: do not skip tutorial tests + return + + skip_tutorials = pytest.mark.skip(reason="need --run-tutorials option to run") + for item in items: + if "tutorials" in item.keywords: + item.add_marker(skip_tutorials) From cb62b40042d8ac58ac76250b882ec4062f3489fd Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:12:17 +0000 Subject: [PATCH 04/11] Add pytest marker for tutorial notebooks in test_execute_notebook --- tests/test_tutorials.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_tutorials.py b/tests/test_tutorials.py index 4d7ed8417..85f6decb0 100644 --- a/tests/test_tutorials.py +++ b/tests/test_tutorials.py @@ -39,6 +39,7 @@ def _find_tutorial_notebooks(): _NOTEBOOKS = _find_tutorial_notebooks() +@pytest.mark.tutorials @pytest.mark.parametrize("nb_path", _NOTEBOOKS, ids=[p.name for p in _NOTEBOOKS]) def test_execute_notebook(nb_path): """Execute a single Jupyter notebook and fail if any cell errors occur. From 867444199f21a434108d6b58d2c683b527109d4c Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:16:44 +0000 Subject: [PATCH 05/11] Update Python version in CI workflow from. 3.13 to 3.14 --- .github/workflows/python.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index cac1634b3..70d37664b 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -10,7 +10,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.10', '3.13'] + python-version: ['3.10', '3.14'] steps: - uses: actions/checkout@v5 @@ -39,7 +39,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.13'] + python-version: ['3.14'] steps: - uses: actions/checkout@v4 @@ -64,7 +64,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.13'] + python-version: ['3.14'] steps: - uses: actions/checkout@v4 @@ -89,7 +89,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.13'] + python-version: ['3.14'] steps: - uses: actions/checkout@v5 From 28f38608b920589485ee1cd520fec64ddba7e9a0 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:26:36 +0000 Subject: [PATCH 06/11] Don't skip tutorial tests if that file is explicitly run --- tests/conftest.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/conftest.py b/tests/conftest.py index 4e2b72fbd..ecb80f01e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -21,6 +21,12 @@ def pytest_collection_modifyitems(config, items): # --run-tutorials given in cli: do not skip tutorial tests return + # Check if test_tutorials.py was explicitly specified + args = config.invocation_params.args + if any("test_tutorials.py" in str(arg) for arg in args): + # test_tutorials.py explicitly run: do not skip + return + skip_tutorials = pytest.mark.skip(reason="need --run-tutorials option to run") for item in items: if "tutorials" in item.keywords: From ae9d5a092899917fff9ea648e7121043d7d0da4d Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:30:20 +0000 Subject: [PATCH 07/11] exclude tutorials from pytest for specifically macos13 with python 3.14 since open_spiel does not build correctly --- .github/workflows/python.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 70d37664b..199dce7ca 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -52,12 +52,11 @@ 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 - name: Build extension run: | python -m pip install -v . - name: Run tests - run: pytest --run-tutorials + run: pytest macos-14: runs-on: macos-14 From 0cee463cb552a9d36f9ac3a1a7a92a9941da1b4b Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:46:32 +0000 Subject: [PATCH 08/11] Add instructions for running tutorial notebook tests with pytest --- doc/developer.contributing.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/developer.contributing.rst b/doc/developer.contributing.rst index 43d4a4826..ce4f809c0 100644 --- a/doc/developer.contributing.rst +++ b/doc/developer.contributing.rst @@ -99,6 +99,11 @@ You can also run the tests locally before submitting your pull request, using `p pytest +3. [Optional] If you wish to run the tutorial notebook tests, you will need to add the ``--run-tutorials`` flag, which require the `doc` dependencies: :: + + pip install -r doc/requirements.txt + pytest --run-tutorials + Adding to the test suite ^^^^^^^^^^^^^^^^^^^^^^^^ From d7c402f270f0494c6eacc336f6af2bf12ae91aeb Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:49:42 +0000 Subject: [PATCH 09/11] Update Python version requirement from >=3.9 to >=3.10 in pyproject.toml --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fb4f80b43..914ba77c7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "pygambit" version = "16.4.0" description = "The package for computation in game theory" readme = "src/README.rst" -requires-python = ">=3.9" +requires-python = ">=3.10" license = "GPL-2.0-or-later" authors = [ {name = "Theodore Turocy", email = "ted.turocy@gmail.com"}, @@ -17,7 +17,6 @@ keywords = ["game theory", "Nash equilibrium"] classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", From 3504b7711e6c35d03f5f6ea4c9ef41fa2c9e1df0 Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Thu, 4 Dec 2025 15:51:20 +0000 Subject: [PATCH 10/11] Add Python 3.14 to the list of supported programming languages in classifiers --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 914ba77c7..a58c8ba72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ classifiers=[ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering :: Mathematics" ] From a0a82a8956ba02ea39729a49dc9ba0ab3edcff86 Mon Sep 17 00:00:00 2001 From: Theodore Turocy Date: Mon, 8 Dec 2025 09:51:11 +0000 Subject: [PATCH 11/11] Roll back pyversion bump (being handled in another PR) --- .github/workflows/python.yml | 8 ++++---- pyproject.toml | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 199dce7ca..648ee0bb4 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -10,7 +10,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.10', '3.14'] + python-version: ['3.9', '3.13'] steps: - uses: actions/checkout@v5 @@ -39,7 +39,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.14'] + python-version: ['3.13'] steps: - uses: actions/checkout@v4 @@ -63,7 +63,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.14'] + python-version: ['3.13'] steps: - uses: actions/checkout@v4 @@ -88,7 +88,7 @@ jobs: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name strategy: matrix: - python-version: ['3.14'] + python-version: ['3.13'] steps: - uses: actions/checkout@v5 diff --git a/pyproject.toml b/pyproject.toml index a58c8ba72..fb4f80b43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "pygambit" version = "16.4.0" description = "The package for computation in game theory" readme = "src/README.rst" -requires-python = ">=3.10" +requires-python = ">=3.9" license = "GPL-2.0-or-later" authors = [ {name = "Theodore Turocy", email = "ted.turocy@gmail.com"}, @@ -17,11 +17,11 @@ keywords = ["game theory", "Nash equilibrium"] classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Science/Research", + "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering :: Mathematics" ]