From 4478a6724c84229b7bde25b7d64733fb77dbc677 Mon Sep 17 00:00:00 2001 From: Jay Pantone Date: Fri, 23 Oct 2026 10:55:13 -0500 Subject: [PATCH 1/4] Modernize GitHub Actions test environments --- .github/dependabot.yml | 5 + .github/requirements-develop.txt | 3 + .github/workflows/build-and-deploy.yml | 4 +- .github/workflows/test.yml | 173 +++++++++++++------------ .pre-commit-config.yaml | 2 +- README.rst | 30 +++++ tox.ini | 14 +- 7 files changed, 141 insertions(+), 90 deletions(-) create mode 100644 .github/requirements-develop.txt diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2775ad7e..570b26ee 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -5,6 +5,11 @@ version: 2 updates: + - package-ecosystem: "github-actions" + directory: "/" + target-branch: "develop" + schedule: + interval: "weekly" - package-ecosystem: "pip" # See documentation for possible values directory: "/" # Location of package manifests schedule: diff --git a/.github/requirements-develop.txt b/.github/requirements-develop.txt new file mode 100644 index 00000000..0cdf227f --- /dev/null +++ b/.github/requirements-develop.txt @@ -0,0 +1,3 @@ +# Install these inside tox for checks against the development branches. +comb-spec-searcher @ git+https://github.com/PermutaTriangle/comb_spec_searcher.git@develop +permuta @ git+https://github.com/PermutaTriangle/Permuta.git@develop diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index faccd5cc..20453edf 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -9,8 +9,8 @@ jobs: build-and-deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 with: python-version: "3.14" - name: install dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4963c6d0..d63953c1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,83 +1,90 @@ -name: tests - -on: [push, pull_request] - -jobs: - - test: - strategy: - fail-fast: false - matrix: - include: - - python: "3.14" - toxenv: flake8 - os: ubuntu-latest - - python: "3.14" - toxenv: mypy - os: ubuntu-latest - - python: "3.14" - toxenv: pylint - os: ubuntu-latest - - python: "3.14" - toxenv: black - os: ubuntu-latest - - - python: "3.10" - toxenv: py310 - os: ubuntu-latest - - python: "3.11" - toxenv: py311 - os: ubuntu-latest - - python: "3.12" - toxenv: py312 - os: ubuntu-latest - - python: "3.13" - toxenv: py313 - os: ubuntu-latest - - python: "3.14" - toxenv: py314 - os: ubuntu-latest - - - python: "pypy-3.10" - toxenv: pypy310 - os: ubuntu-latest - - python: "pypy-3.11" - toxenv: pypy311 - os: ubuntu-latest - - - python: "3.14" - toxenv: py314 - os: macos-latest - - python: "3.14" - toxenv: py314 - os: windows-latest - - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python }} - - name: Install dependencies from develop branch - if: github.ref != 'refs/heads/master' && !(github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master') - run: | - echo "Installing dependencies from develop branches instead of PyPI" - python -m pip install git+https://github.com/PermutaTriangle/comb_spec_searcher.git@develop - python -m pip install git+https://github.com/PermutaTriangle/Permuta.git@develop - - # Install the project in development mode to work with the new dependencies - python -m pip install -e . - - # Verify installed versions - echo "Checking installed comb_spec_searcher version:" - python -c "import comb_spec_searcher; print(comb_spec_searcher.__version__)" - echo "Checking installed permuta version:" - python -c "import permuta; print(permuta.__version__)" - - name: install dependencies - run: python -m pip install --upgrade pip tox - - name: run - env: - TOXENV: ${{ matrix.toxenv }} - run: tox - - name: setup - run: pip install -e . +name: tests + +on: + push: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + test: + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + include: + - python: "3.14" + toxenv: flake8 + os: ubuntu-latest + - python: "3.14" + toxenv: mypy + os: ubuntu-latest + - python: "3.14" + toxenv: pylint + os: ubuntu-latest + - python: "3.14" + toxenv: black + os: ubuntu-latest + + - python: "3.10" + toxenv: py310 + os: ubuntu-latest + - python: "3.11" + toxenv: py311 + os: ubuntu-latest + - python: "3.12" + toxenv: py312 + os: ubuntu-latest + - python: "3.13" + toxenv: py313 + os: ubuntu-latest + - python: "3.14" + toxenv: py314 + os: ubuntu-latest + - python: "3.15" + toxenv: py315 + os: ubuntu-latest + + - python: "pypy-3.10" + toxenv: pypy310 + os: ubuntu-latest + - python: "pypy-3.11" + toxenv: pypy311 + os: ubuntu-latest + + - python: "3.14" + toxenv: py314 + os: macos-latest + - python: "3.14" + toxenv: py314 + os: windows-latest + + runs-on: ${{ matrix.os }} + env: + # Release checks use PyPI; other branches test both development dependencies. + # tox reads this when resolving dependencies inside each test environment. + TILINGS_TEST_DEPS: >- + ${{ github.ref != 'refs/heads/master' && + !(github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master') && + '-r.github/requirements-develop.txt' || '' }} + steps: + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python }} + cache: pip + cache-dependency-path: | + pyproject.toml + tox.ini + .github/requirements-develop.txt + - name: Install tox + run: python -m pip install --upgrade pip "tox>=4,<5" + - name: Run checks + run: python -m tox run -e ${{ matrix.toxenv }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fe30c3b4..640716bf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: - repo: https://github.com/psf/black - rev: 22.10.0 + rev: 25.12.0 hooks: - id: black diff --git a/README.rst b/README.rst index 874ac7bb..87e82207 100644 --- a/README.rst +++ b/README.rst @@ -70,6 +70,36 @@ You should then be all set up to use ``tilings`` and the ``TileScope`` algorithm "Performance" section at the end of this document provides some more technical information. +Running the checks +------------------ + +Install tox and run a test environment for an installed Python version: + +.. code:: bash + + python -m pip install "tox>=4,<5" + python -m tox run -e py314 + +The test environments cover CPython 3.10 through 3.15 and PyPy 3.10 and 3.11. +The ``flake8``, ``mypy``, ``pylint``, and ``black`` environments use Python 3.14. +Pass pytest arguments after ``--``, for example +``python -m tox run -e py314 -- tests/test_griddedperm.py``. + +By default, tox installs the released dependencies declared in ``pyproject.toml``. +To test against the ``develop`` branches of both ``comb_spec_searcher`` and +``permuta``, set the environment variable ``TILINGS_TEST_DEPS`` to +``-r.github/requirements-develop.txt`` before running tox. For example, in a +POSIX shell: + +.. code:: bash + + TILINGS_TEST_DEPS=-r.github/requirements-develop.txt python -m tox run -e py314 + +GitHub Actions uses released dependencies for ``master`` and pull requests +targeting ``master``, and development dependencies for other branches. The same +dependency selection applies to tests, mypy, and pylint inside their tox +environments. + What are gridded permutations and tilings? ------------------------------------------ diff --git a/tox.ini b/tox.ini index 0aba2056..553820c9 100644 --- a/tox.ini +++ b/tox.ini @@ -4,9 +4,10 @@ # and then run "tox" from this directory. [tox] +minversion = 4 envlist = flake8, mypy, pylint, black - py{310,311,312,313,314}, + py{310,311,312,313,314,315}, pypy{310,311} [default] @@ -20,15 +21,17 @@ basepython = py312: python3.12 py313: python3.13 py314: python3.14 + py315: python3.15 pypy310: pypy3.10 pypy311: pypy3.11 deps = pytest pytest-timeout + {env:TILINGS_TEST_DEPS:} commands = - pip install --force-reinstall git+https://github.com/PermutaTriangle/comb_spec_searcher.git@develop - pip freeze - pytest + python -m pip check + python -m pip freeze + python -m pytest {posargs} [pytest] addopts = --doctest-modules --doctest-ignore-import-errors @@ -51,6 +54,7 @@ description = run pylint (static code analysis) basepython = {[default]basepython} deps = pylint + {env:TILINGS_TEST_DEPS:} commands = pylint tilings [testenv:mypy] @@ -60,11 +64,13 @@ deps = mypy types-requests types-tabulate + {env:TILINGS_TEST_DEPS:} commands = mypy [testenv:black] description = check that comply with autoformating basepython = {[default]basepython} +skip_install = True deps = black==25.12.0 commands = black --check --diff . From 68317aa1ea661a2686e9d158f0253faaf5a1854b Mon Sep 17 00:00:00 2001 From: Jay Pantone Date: Fri, 23 Oct 2026 11:54:03 -0500 Subject: [PATCH 2/4] Update pylint configuration for current releases Remove the obsolete suggestion-mode option and qualify the configured exception names. Use ValueError for three invalid-input paths so the enabled exception checks pass. --- pylintrc | 10 +++------- tilings/algorithms/requirement_placement.py | 4 ++-- tilings/strategies/factor.py | 2 +- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/pylintrc b/pylintrc index 0564c0cc..487b41c2 100644 --- a/pylintrc +++ b/pylintrc @@ -36,10 +36,6 @@ persistent=yes # Specify a configuration file. #rcfile= -# When enabled, pylint would attempt to guess common misconfiguration and emit -# user-friendly hints instead of false-positive error messages. -suggestion-mode=yes - # Allow loading of arbitrary C extensions. Extensions are imported into the # active Python interpreter and may run arbitrary code. unsafe-load-any-extension=no @@ -517,6 +513,6 @@ preferred-modules= [EXCEPTIONS] # Exceptions that will emit a warning when being caught. Defaults to -# "BaseException, Exception". -overgeneral-exceptions=BaseException, - Exception +# "builtins.BaseException, builtins.Exception". +overgeneral-exceptions=builtins.BaseException, + builtins.Exception diff --git a/tilings/algorithms/requirement_placement.py b/tilings/algorithms/requirement_placement.py index e5fb85d0..1a665d22 100644 --- a/tilings/algorithms/requirement_placement.py +++ b/tilings/algorithms/requirement_placement.py @@ -97,7 +97,7 @@ def already_placed( return cell in self._point_row_cells if self.own_col: # Only placing in own column return cell in self._point_col_cells - raise Exception("Not placing at all!!") + raise ValueError("Not placing at all!!") def _point_translation( self, gp: GriddedPerm, index: int, placed_cell: Cell @@ -283,7 +283,7 @@ def _farther(c1: Cell, c2: Cell, direction: Dir) -> bool: return c1[1] > c2[1] if direction == DIR_SOUTH: return c1[1] < c2[1] - raise Exception("Invalid direction") + raise ValueError("Invalid direction") def forced_obstructions_from_requirement( self, diff --git a/tilings/strategies/factor.py b/tilings/strategies/factor.py index 686bb468..358a47c7 100644 --- a/tilings/strategies/factor.py +++ b/tilings/strategies/factor.py @@ -633,7 +633,7 @@ def __str__(self) -> str: elif self.factor_class is FactorWithMonotoneInterleavingStrategy: s = "factor with monotone interleaving" else: - raise Exception("Invalid interleaving type") + raise ValueError("Invalid interleaving type") if self.unions: s = "unions of " + s if self.tracked: From e25a94fb2a8d8377241c4345b416bbf2d94d26a9 Mon Sep 17 00:00:00 2001 From: Jay Pantone Date: Fri, 23 Oct 2026 12:10:26 -0500 Subject: [PATCH 3/4] Make Python 3.15 primary and add stable PyPy 3.12 coverage Require Python 3.11 or newer, remove CPython and PyPy 3.10 environments, and run linting, packaging, and cross-platform tests on 3.15. Supply the dependencies of bundled PyPy packages so pip check succeeds in isolated tox environments. --- .github/workflows/build-and-deploy.yml | 2 +- .github/workflows/test.yml | 25 +++++++++++-------------- CHANGELOG.md | 13 +++++++++++++ README.rst | 15 ++++++++++----- pyproject.toml | 7 ++++--- tox.ini | 12 +++++++----- 6 files changed, 46 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index 20453edf..b7e1ab84 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v7 - uses: actions/setup-python@v7 with: - python-version: "3.14" + python-version: "3.15" - name: install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d63953c1..b8b62fea 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,22 +20,19 @@ jobs: fail-fast: false matrix: include: - - python: "3.14" + - python: "3.15" toxenv: flake8 os: ubuntu-latest - - python: "3.14" + - python: "3.15" toxenv: mypy os: ubuntu-latest - - python: "3.14" + - python: "3.15" toxenv: pylint os: ubuntu-latest - - python: "3.14" + - python: "3.15" toxenv: black os: ubuntu-latest - - python: "3.10" - toxenv: py310 - os: ubuntu-latest - python: "3.11" toxenv: py311 os: ubuntu-latest @@ -52,18 +49,18 @@ jobs: toxenv: py315 os: ubuntu-latest - - python: "pypy-3.10" - toxenv: pypy310 - os: ubuntu-latest - python: "pypy-3.11" toxenv: pypy311 os: ubuntu-latest + - python: "pypy-3.12" + toxenv: pypy312 + os: ubuntu-latest - - python: "3.14" - toxenv: py314 + - python: "3.15" + toxenv: py315 os: macos-latest - - python: "3.14" - toxenv: py314 + - python: "3.15" + toxenv: py315 os: windows-latest runs-on: ${{ matrix.os }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c317fe0..58ef3f09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed +- Minimum Python version is now 3.11; CPython and PyPy 3.10 are no longer supported. +- Python 3.15 is the primary version for linting, packaging, and cross-platform + tests, with compatibility tests for CPython 3.11 through 3.14. +- Black targets Python 3.11, the minimum supported version. + +### Added +- Required CI coverage for stable PyPy 3.12 alongside PyPy 3.11. + +### Fixed +- Install the dependencies of PyPy's bundled cffi and HPy packages in tox so + dependency checks pass. + ## [4.1.0] - 2026-01-15 ### Changed - new GriddedPerm.contains_patt function checks positions first, then pattern diff --git a/README.rst b/README.rst index 87e82207..1682ae48 100644 --- a/README.rst +++ b/README.rst @@ -52,6 +52,8 @@ To install ``tilings`` on your system, run: pip install tilings +Python 3.11 or newer is required. + If you would like to edit the source code, you should install ``tilings`` in development mode by cloning the repository, running @@ -78,12 +80,15 @@ Install tox and run a test environment for an installed Python version: .. code:: bash python -m pip install "tox>=4,<5" - python -m tox run -e py314 + python -m tox run -e py315 -The test environments cover CPython 3.10 through 3.15 and PyPy 3.10 and 3.11. -The ``flake8``, ``mypy``, ``pylint``, and ``black`` environments use Python 3.14. +The test environments cover CPython 3.11 through 3.15 and PyPy 3.11 and 3.12. +Python 3.15 is used for the ``flake8``, ``mypy``, ``pylint``, and ``black`` +environments, packaging, and the Linux, macOS, and Windows test jobs. +Older supported CPython versions and both PyPy versions are tested on Linux. +PyPy 3.12 uses a stable release and is a required check. Pass pytest arguments after ``--``, for example -``python -m tox run -e py314 -- tests/test_griddedperm.py``. +``python -m tox run -e py315 -- tests/test_griddedperm.py``. By default, tox installs the released dependencies declared in ``pyproject.toml``. To test against the ``develop`` branches of both ``comb_spec_searcher`` and @@ -93,7 +98,7 @@ POSIX shell: .. code:: bash - TILINGS_TEST_DEPS=-r.github/requirements-develop.txt python -m tox run -e py314 + TILINGS_TEST_DEPS=-r.github/requirements-develop.txt python -m tox run -e py315 GitHub Actions uses released dependencies for ``master`` and pull requests targeting ``master``, and development dependencies for other branches. The same diff --git a/pyproject.toml b/pyproject.toml index cc3aa80c..5e7872cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,16 +29,17 @@ classifiers = [ "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 3", - "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 :: 3.15", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Education", "Topic :: Scientific/Engineering :: Mathematics", ] -requires-python = ">=3.10" +requires-python = ">=3.11" dependencies = [ "comb-spec-searcher>=4.2.1", "permuta>=2.3.0", @@ -68,7 +69,7 @@ include = [ ] [tool.black] -target-version = ['py310'] +target-version = ['py311'] include = '\.pyi?$' exclude = ''' ( diff --git a/tox.ini b/tox.ini index 553820c9..d229c47d 100644 --- a/tox.ini +++ b/tox.ini @@ -7,26 +7,28 @@ minversion = 4 envlist = flake8, mypy, pylint, black - py{310,311,312,313,314,315}, - pypy{310,311} + py{311,312,313,314,315}, + pypy{311,312} [default] -basepython=python3.14 +basepython=python3.15 [testenv] description = run test basepython = - py310: python3.10 py311: python3.11 py312: python3.12 py313: python3.13 py314: python3.14 py315: python3.15 - pypy310: pypy3.10 pypy311: pypy3.11 + pypy312: pypy3.12 deps = pytest pytest-timeout + # PyPy bundles cffi and HPy; virtualenv may omit their dependencies. + pycparser; platform_python_implementation == "PyPy" + setuptools; platform_python_implementation == "PyPy" {env:TILINGS_TEST_DEPS:} commands = python -m pip check From 4f84749a055d242c061a1800b22a29bfa4531ebd Mon Sep 17 00:00:00 2001 From: Jay Pantone Date: Tue, 27 Oct 2026 12:43:38 -0500 Subject: [PATCH 4/4] Trim README to a single supported-Python line Co-Authored-By: Claude Opus 5.5 --- README.rst | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/README.rst b/README.rst index 1682ae48..19695163 100644 --- a/README.rst +++ b/README.rst @@ -72,39 +72,6 @@ You should then be all set up to use ``tilings`` and the ``TileScope`` algorithm "Performance" section at the end of this document provides some more technical information. -Running the checks ------------------- - -Install tox and run a test environment for an installed Python version: - -.. code:: bash - - python -m pip install "tox>=4,<5" - python -m tox run -e py315 - -The test environments cover CPython 3.11 through 3.15 and PyPy 3.11 and 3.12. -Python 3.15 is used for the ``flake8``, ``mypy``, ``pylint``, and ``black`` -environments, packaging, and the Linux, macOS, and Windows test jobs. -Older supported CPython versions and both PyPy versions are tested on Linux. -PyPy 3.12 uses a stable release and is a required check. -Pass pytest arguments after ``--``, for example -``python -m tox run -e py315 -- tests/test_griddedperm.py``. - -By default, tox installs the released dependencies declared in ``pyproject.toml``. -To test against the ``develop`` branches of both ``comb_spec_searcher`` and -``permuta``, set the environment variable ``TILINGS_TEST_DEPS`` to -``-r.github/requirements-develop.txt`` before running tox. For example, in a -POSIX shell: - -.. code:: bash - - TILINGS_TEST_DEPS=-r.github/requirements-develop.txt python -m tox run -e py315 - -GitHub Actions uses released dependencies for ``master`` and pull requests -targeting ``master``, and development dependencies for other branches. The same -dependency selection applies to tests, mypy, and pylint inside their tox -environments. - What are gridded permutations and tilings? ------------------------------------------