Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ff61170
Update dependency installation in GitHub Actions workflow
edwardchalstrey1 Dec 2, 2025
c05dfb8
Refactor GitHub Actions to simplify test execution and skip notebooks…
edwardchalstrey1 Dec 2, 2025
035c2fc
Skip installing documentation requirements for Python 3.9 in GitHub A…
edwardchalstrey1 Dec 2, 2025
50174c6
Revert "Skip installing documentation requirements for Python 3.9 in …
edwardchalstrey1 Dec 2, 2025
f0ee6b3
weaken pytest version constraint
edwardchalstrey1 Dec 2, 2025
03c1cd3
remove most package version pinning in requirements files
edwardchalstrey1 Dec 2, 2025
1995061
remove version pinning for open_spiel in requirements.txt
edwardchalstrey1 Dec 2, 2025
0390493
remove Cython from doc requirements since it is already installed as …
edwardchalstrey1 Dec 2, 2025
a54d99f
Revert "remove Cython from doc requirements since it is already insta…
edwardchalstrey1 Dec 2, 2025
0953adb
temporarily remove path ignores to run tests on all PRs
edwardchalstrey1 Dec 2, 2025
4af7bae
remove paths-ignore from workflow files to ensure all changes trigger…
edwardchalstrey1 Dec 2, 2025
04dbbae
improve spacing to satisfy pre-commit hook
edwardchalstrey1 Dec 2, 2025
1cc57ab
install requirements consistently across workflows
edwardchalstrey1 Dec 2, 2025
70de66c
update running tutorials locally page
edwardchalstrey1 Dec 2, 2025
c48bf0b
refactor tutorial installation instructions for clarity and consistency
edwardchalstrey1 Dec 2, 2025
5c58529
furthe tidying of instructions for running tutorials locally
edwardchalstrey1 Dec 2, 2025
861e2c8
skip openspiel notebook test on Windows GH action and add minimal dep…
edwardchalstrey1 Dec 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/tutorial_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
required: false
8 changes: 0 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/osxbinary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: MacOS static GUI binary

on:
push:
paths-ignore:
- 'doc/**'
- '.github/ISSUE_TEMPLATE/**'
- 'README.md'
tags:
- 'v*'
schedule:
Expand Down
32 changes: 13 additions & 19 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@ name: pygambit Python extension

on:
push:
paths-ignore:
- 'doc/**'
- '.github/ISSUE_TEMPLATE/**'
- 'README.md'
pull_request:
paths-ignore:
- 'doc/**'
- '.github/ISSUE_TEMPLATE/**'
- 'README.md'

jobs:
linux:
Expand All @@ -29,7 +21,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
Expand All @@ -38,13 +32,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
Expand All @@ -62,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 .
Expand All @@ -85,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 .
Expand All @@ -108,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 nbformat nbclient ipykernel jupyter matplotlib
- name: Build extension
run: |
python -m pip install -v .
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ name: pygambit wheels

on:
push:
paths-ignore:
- 'doc/**'
- '.github/ISSUE_TEMPLATE/**'
- 'README.md'
tags:
- 'v*'
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ Gambit.app/*
doc/tutorials/games/*.nfg
doc/tutorials/games/*.efg
*.dmg
Gambit.app/*
Gambit.app/*
24 changes: 12 additions & 12 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
open_spiel==1.6.9
Cython
numpy
scipy
pydata-sphinx-theme
sphinx_design
sphinx-autobuild
nbsphinx
ipython
matplotlib
pickleshare
jupyter
open_spiel
28 changes: 20 additions & 8 deletions doc/tutorials/running_locally.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,34 @@
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 `pygambit`:

* To install the latest release from PyPI::

pip install pygambit

* Alternatively, to install the latest development version::

python -m venv pygambit-env
source pygambit-env/bin/activate
pip install pygambit
pip install .

3. Install other requirements (including `JupyterLab`) 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 <https://openspiel.readthedocs.io/en/latest/windows.html>`_ for details.

4. Open `JupyterLab` and click on any of the tutorial notebooks (files ending in `.ipynb`) ::

cd tutorials
jupyter lab
8 changes: 4 additions & 4 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pytest==9.0.0
nbformat==5.10.4
nbclient==0.10.2
ipykernel==6.30.1
pytest
nbformat
nbclient
ipykernel
10 changes: 10 additions & 0 deletions tests/test_tutorials.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import contextlib
import os
import sys
from pathlib import Path

import nbformat
Expand Down Expand Up @@ -45,6 +46,15 @@ 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")

# 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.
Expand Down
Loading