From b84ce7188c60e35cdfcb18426f23aad647b1d86d Mon Sep 17 00:00:00 2001 From: Jim Garrison Date: Wed, 7 Oct 2026 17:06:00 -0400 Subject: [PATCH] Test the minimum supported dependency versions The Tests workflow installs the newest version of everything, so the floors declared in pyproject.toml were never exercised. Add a workflow that pins every dependency to its declared minimum with extremal-python-dependencies and runs the suite, following the pattern used in qiskit-addon-sqd. Standing the workflow up showed the existing floors were aspirational rather than tested, and none of them installed: - mpi4py 3.0.0 does not build against current setuptools, whose new_compiler() no longer accepts the dry_run argument mpi4py's build scripts pass. Every 3.x release fails this way, so the floor becomes 4.0.0. - pybind11 2.6.0's headers do not compile with a current GCC: attr.h and pybind11.h use std::uint16_t without including . 2.12.0 is the oldest that builds here. - numpy 1.19.0 predates Python 3.10 and has no wheel for any supported version, so it built from source and failed. It was also inconsistent with the test extra, since qiskit-addon-sqd requires numpy>=1.26. - setuptools>=77 pins to the exact version "77", which does not exist on PyPI; the first 77.x release is 77.0.1. With those raised, `pip install .[test]` resolves in a single pass and the serial and MPI suites both pass on Python 3.10. Note that pinning numpy to 1.26.0 backtracks qiskit to 2.4.2, since qiskit 2.5 requires numpy>=2.0 -- that is the resolver doing its job, not a conflict. Only Linux and Python 3.10 are covered, matching the original: the floors are what is under test here, not the platform matrix. Development-version tests were first suggested in #6 alongside these, which stays open for the remaining items. Assisted-by: Claude Opus 5 --- .github/workflows/test_minimum_versions.yml | 49 +++++++++++++++++++ pyproject.toml | 8 +-- ...pported-dependencies-b1e7c5649c3201d1.yaml | 8 +++ 3 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/test_minimum_versions.yml create mode 100644 releasenotes/notes/minimum-supported-dependencies-b1e7c5649c3201d1.yaml diff --git a/.github/workflows/test_minimum_versions.yml b/.github/workflows/test_minimum_versions.yml new file mode 100644 index 0000000..1e775fe --- /dev/null +++ b/.github/workflows/test_minimum_versions.yml @@ -0,0 +1,49 @@ +name: Minimum version tests + +on: + push: + branches: + - main + - 'stable/**' + pull_request: + branches: + - main + - 'stable/**' + +jobs: + tests: + name: minimum version tests (${{ matrix.os }}, ${{ matrix.python-version }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + strategy: + fail-fast: false + max-parallel: 4 + matrix: + os: [ubuntu-latest] + python-version: ["3.10"] + steps: + - uses: actions/checkout@v7 + with: + # The reference energies the tests check against come from data in the + # vendored upstream checkout, and setup.py needs its headers to compile. + submodules: recursive + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v7 + with: + python-version: ${{ matrix.python-version }} + - name: Install MPI and BLAS (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get update + sudo apt-get install -y libopenmpi-dev openmpi-bin libopenblas-dev + - name: Install dependencies (minimum versions) + shell: bash + run: | + python -m pip install --upgrade pip + python -m pip install 'extremal-python-dependencies<2' + pip install "tox==$(extremal-python-dependencies get-tox-minversion)" + extremal-python-dependencies pin-dependencies-to-minimum --inplace + - name: Test using tox environments + shell: bash + run: | + tox -e py,notebook,mpi diff --git a/pyproject.toml b/pyproject.toml index a235da2..30b4ed8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=77", "wheel", "pybind11>=2.6.0", "mpi4py>=3.0.0"] +requires = ["setuptools>=77.0.1", "wheel", "pybind11>=2.12.0", "mpi4py>=4.0.0"] build-backend = "setuptools.build_meta" [project] @@ -27,8 +27,8 @@ classifiers = [ "Programming Language :: C++", ] dependencies = [ - "mpi4py>=3.0.0", - "numpy>=1.19.0", + "mpi4py>=4.0.0", + "numpy>=1.26.0", ] [project.optional-dependencies] @@ -83,4 +83,4 @@ testpaths = ["test"] # skips by default: a bare count of skips would not distinguish "this case is slow" or # "this backend was not built" from "the reference data is missing". --durations shows # where the time goes, the cases differing by orders of magnitude in cost. -addopts = "-rs --durations=10" \ No newline at end of file +addopts = "-rs --durations=10" diff --git a/releasenotes/notes/minimum-supported-dependencies-b1e7c5649c3201d1.yaml b/releasenotes/notes/minimum-supported-dependencies-b1e7c5649c3201d1.yaml new file mode 100644 index 0000000..e6c7250 --- /dev/null +++ b/releasenotes/notes/minimum-supported-dependencies-b1e7c5649c3201d1.yaml @@ -0,0 +1,8 @@ +--- +upgrade: + - | + The declared minimum versions of several dependencies have been raised to + the oldest ones this package actually builds and runs against: + ``numpy>=1.26.0`` (was 1.19.0), ``mpi4py>=4.0.0`` (was 3.0.0), + ``pybind11>=2.12.0`` (was 2.6.0), and ``setuptools>=77.0.1`` (was 77). + The previous floors were aspirational rather than tested.