From 6e5509780cb4be82083a0c9e1552667d1c9bf400 Mon Sep 17 00:00:00 2001 From: Jay Pantone Date: Fri, 23 Oct 2026 12:36:31 -0500 Subject: [PATCH 1/2] Modernize CI for Python 3.15 and PyPy 3.12 Require Python 3.11 or newer, retire CPython and PyPy 3.10, and run primary lint, build, and cross-platform jobs on Python 3.15. Add stable PyPy 3.12 coverage, update Actions and Black tooling, and satisfy dependencies of bundled PyPy packages in tox. --- .github/dependabot.yml | 5 ++ .github/workflows/build-and-deploy.yml | 6 +-- .github/workflows/test.yml | 65 +++++++++++++++----------- .pre-commit-config.yaml | 2 +- CHANGELOG.md | 10 ++++ README.rst | 14 +++++- pyproject.toml | 7 +-- tox.ini | 20 +++++--- 8 files changed, 87 insertions(+), 42 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9d866e3..6af4d85 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/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml index faccd5c..b7e1ab8 100644 --- a/.github/workflows/build-and-deploy.yml +++ b/.github/workflows/build-and-deploy.yml @@ -9,10 +9,10 @@ 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" + 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 873bc6d..b764da4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,30 +1,38 @@ name: tests -on: [push, pull_request] +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" + - 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 @@ -37,32 +45,35 @@ jobs: - python: "3.14" toxenv: py314 os: ubuntu-latest - - - python: "pypy3.10" - toxenv: pypy310 + - python: "3.15" + toxenv: py315 os: ubuntu-latest - - python: "pypy3.11" + + - 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 }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@v7 + - uses: actions/setup-python@v7 with: - python-version: ${{ matrix.python }} - - 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 . + python-version: ${{ matrix.python }} + cache: pip + cache-dependency-path: | + pyproject.toml + tox.ini + - 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 fe30c3b..640716b 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/CHANGELOG.md b/CHANGELOG.md index 50ecb90..6dd2a9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,17 @@ 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 primary for linting, packaging, and cross-platform tests, with + CPython 3.11 through 3.14 compatibility coverage. +- Modernized GitHub Actions, dependency caching, and Black configuration. + +### Added +- Required CI coverage for stable PyPy 3.12 alongside PyPy 3.11. + ### Fixed +- Supply the dependencies of PyPy's bundled cffi and HPy packages in tox. - Fixed bug in `Perm.rtlmax_ltrmin_decomposition` and fixed associated tests. ## 2.3.1 - 2025-06-13 diff --git a/README.rst b/README.rst index 1277f39..a8aa973 100644 --- a/README.rst +++ b/README.rst @@ -43,6 +43,8 @@ To install Permuta on your system, run: pip install permuta +Python 3.11 or newer is required. + It is also possible to install Permuta in development mode to work on the source code, in which case you run the following after cloning the repository: @@ -50,11 +52,19 @@ source code, in which case you run the following after cloning the repository: pip install -e . -To run the unit tests: +To run the unit tests with an installed Python version: .. code-block:: bash - tox + 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 linting, type checking, packaging, and the Linux, +macOS, and Windows test jobs. Older supported CPython versions and both PyPy +versions are tested on Linux. Black targets the minimum supported Python 3.11. +Pass pytest arguments after ``--``, for example +``python -m tox run -e py315 -- tests``. Using Permuta ############# diff --git a/pyproject.toml b/pyproject.toml index 6835be4..10b31a9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,16 +17,17 @@ classifiers = [ "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", - "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 = [ "automata-lib==9.2.0", ] @@ -53,7 +54,7 @@ include = [ ] [tool.black] -target-version = ['py310'] +target-version = ['py311'] include = '\.pyi?$' exclude = ''' diff --git a/tox.ini b/tox.ini index 082c98b..c0808e0 100644 --- a/tox.ini +++ b/tox.ini @@ -4,28 +4,35 @@ # and then run "tox" from this directory. [tox] +minversion = 4 envlist = flake8, mypy, pylint, black - py{310,311,312,313,314}, - 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 - pypy310: pypy3.10 + py315: python3.15 pypy311: pypy3.11 + pypy312: pypy3.12 deps = pytest pytest-timeout -commands = pytest + # PyPy bundles cffi and HPy; virtualenv may omit their dependencies. + pycparser; platform_python_implementation == "PyPy" + setuptools; platform_python_implementation == "PyPy" +commands = + python -m pip check + python -m pip freeze + python -m pytest {posargs} [pytest] addopts = --doctest-modules --doctest-ignore-import-errors @@ -59,6 +66,7 @@ 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 7a77161e7c9cd8932f3865ce4052939921244444 Mon Sep 17 00:00:00 2001 From: Jay Pantone Date: Tue, 27 Oct 2026 12:43:34 -0500 Subject: [PATCH 2/2] Trim README to a single supported-Python line Co-Authored-By: Claude Opus 5.5 --- README.rst | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/README.rst b/README.rst index a8aa973..a79fd9e 100644 --- a/README.rst +++ b/README.rst @@ -52,19 +52,11 @@ source code, in which case you run the following after cloning the repository: pip install -e . -To run the unit tests with an installed Python version: +To run the unit tests: .. code-block:: 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 linting, type checking, packaging, and the Linux, -macOS, and Windows test jobs. Older supported CPython versions and both PyPy -versions are tested on Linux. Black targets the minimum supported Python 3.11. -Pass pytest arguments after ``--``, for example -``python -m tox run -e py315 -- tests``. + tox Using Permuta #############