From 9076b40ddc114d755ebf3406c6d56cb7a85e67d4 Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Wed, 14 Oct 2026 09:57:19 +0100 Subject: [PATCH 1/6] ci(deps): add dependency floor checks --- .github/workflows/dependency-floors.yaml | 54 ++++++++++++++++++++++++ docs/developer_guide.rst | 21 +++++++++ 2 files changed, 75 insertions(+) create mode 100644 .github/workflows/dependency-floors.yaml diff --git a/.github/workflows/dependency-floors.yaml b/.github/workflows/dependency-floors.yaml new file mode 100644 index 00000000..99812ffb --- /dev/null +++ b/.github/workflows/dependency-floors.yaml @@ -0,0 +1,54 @@ +name: Dependency Floors + +on: + pull_request: + paths: + - pyproject.toml + - .github/workflows/dependency-floors.yaml + schedule: + - cron: '0 8 * * 1' + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: dependency-floors-${{ github.ref }} + cancel-in-progress: true + +jobs: + lowest: + name: Lowest dependencies (${{ matrix.os }}, py${{ matrix.python-version }}) + runs-on: ${{ matrix.os }} + timeout-minutes: 30 + + strategy: + fail-fast: false + matrix: + os: [ubuntu-26.04, macos-26, windows-2025-vs2026] + python-version: ["3.12", "3.13", "3.14"] + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: ${{ matrix.python-version }} + + - name: Install uv + run: | + python -m pip install --upgrade pip + python -m pip install uv + + - name: Resolve lowest dependencies as wheels + run: | + uv pip compile pyproject.toml --resolution lowest-direct --only-binary :all: --output-file lowest.txt + cat lowest.txt + + - name: Install lowest dependencies + run: uv pip install --system --resolution lowest-direct -e ".[testing]" + + - name: Run unit tests + run: python -m pytest tests/unit diff --git a/docs/developer_guide.rst b/docs/developer_guide.rst index 640973ad..3827bda6 100644 --- a/docs/developer_guide.rst +++ b/docs/developer_guide.rst @@ -167,9 +167,30 @@ Weekly workflows: - Full regression suite including slow tests - Documentation build across all Python versions +- Dependency floor checks (see :ref:`dependency-policy`) CI also caches regression datasets to improve performance. +.. _dependency-policy: + +Dependency Policy +----------------- + +Runtime dependencies in ``pyproject.toml`` are declared as ranges. The lower +bound (floor) is the oldest release CodeEntropy is known to work with, so that it +stays installable alongside other scientific packages. Floors are only raised +when the code needs a newer release. Upper bounds are widened by Renovate. + +The ``dependency-floors.yaml`` workflow checks this on pull requests that change +``pyproject.toml`` and weekly. It checks that the lowest allowed versions resolve +to installable wheels on each platform and Python version, and that the unit tests +pass with them installed. + +Run the same checks locally with `uv `_:: + + uv pip install --resolution lowest-direct -e ".[testing]" + python -m pytest tests/unit + Building Documentation ---------------------- From dd0baaeeac57e4c3dab4d19e7882c14f1244c698 Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Wed, 14 Oct 2026 10:02:05 +0100 Subject: [PATCH 2/6] fix(deps): align conda recipe ceilings with pyproject --- conda-recipe/meta.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index d8dfa0e9..c4e8fb40 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -23,7 +23,7 @@ requirements: - flit-core >=4,<5 run: - python >=3.12 - - numpy >=2.3.2,<2.5.0 + - numpy >=2.3.2,<2.6.0 - mdanalysis >=2.10,<3.0 - pandas >=2.3.3,<4.0 - psutil >=5.9.4,<8.0 @@ -32,7 +32,7 @@ requirements: - python-art >=5.0,<7.0 - networkx >=2.8,<4.0 - requests >=2.32.2,<3.0 - - rdkit >=2025.3.4,<2026 + - rdkit >=2025.3.4,<2027 - dask >=2025.4.0,<2027.1.0 - distributed >=2025.4.0,<2027.1.0 - dask-jobqueue >=0.9.0,<1.0 From 763c1ffca3bd8b74867173b9f93b5754fc762855 Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Wed, 14 Oct 2026 10:45:32 +0100 Subject: [PATCH 3/6] fix(deps): generate conda recipe dependencies from `pyproject.toml` --- conda-recipe/meta.yaml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml index c4e8fb40..926a8d4e 100644 --- a/conda-recipe/meta.yaml +++ b/conda-recipe/meta.yaml @@ -1,5 +1,12 @@ {% set name = "codeentropy" %} {% set version = "0.0.0" %} +{% set pyproject = load_file_data("../pyproject.toml", from_recipe_dir=True) %} +{% set pip_only = namespace(water_entropy="") %} +{% for dependency in pyproject["project"]["dependencies"] %} +{% if dependency.startswith("waterEntropy") %} +{% set pip_only.water_entropy = dependency %} +{% endif %} +{% endfor %} package: name: {{ name }} @@ -12,7 +19,7 @@ build: noarch: python script: | python -m pip install . -vv --no-deps - PIP_NO_INDEX=0 python -m pip install -vv --index-url https://pypi.org/simple "waterEntropy>=2,<3.0" + PIP_NO_INDEX=0 python -m pip install -vv --index-url https://pypi.org/simple "{{ pip_only.water_entropy }}" entry_points: - CodeEntropy=CodeEntropy.cli:main @@ -22,21 +29,14 @@ requirements: - pip - flit-core >=4,<5 run: - - python >=3.12 - - numpy >=2.3.2,<2.6.0 - - mdanalysis >=2.10,<3.0 - - pandas >=2.3.3,<4.0 - - psutil >=5.9.4,<8.0 - - pyyaml >=6.0.3,<7.0 - - rich >=13.0.0,<16.0 - - python-art >=5.0,<7.0 - - networkx >=2.8,<4.0 - - requests >=2.32.2,<3.0 - - rdkit >=2025.3.4,<2027 - - dask >=2025.4.0,<2027.1.0 - - distributed >=2025.4.0,<2027.1.0 - - dask-jobqueue >=0.9.0,<1.0 - - numba >=0.63.0,<0.70 + - python {{ pyproject["project"]["requires-python"] }} + {% for dependency in pyproject["project"]["dependencies"] %} + {% if dependency.startswith("art>") %} + - python-{{ dependency }} + {% elif not dependency.startswith("waterEntropy") %} + - {{ dependency | lower }} + {% endif %} + {% endfor %} test: imports: From b92cdf4ebd63cb96671e8bb2ae966c1a94ef5134 Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Wed, 14 Oct 2026 10:55:11 +0100 Subject: [PATCH 4/6] fix(deps): raise floors pinned by waterEntropy to tested versions --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6c49e8d1..0c165f1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,10 +37,10 @@ classifiers = [ keywords = ["entropy", "macromolecular systems", "MD simulation"] requires-python = ">=3.12" dependencies = [ - "numpy>=2.3.2,<2.6.0", + "numpy>=2.3.5,<2.6.0", "mdanalysis>=2.10,<3.0", "pandas>=2.3.3,<4.0", - "psutil>=5.9.4,<8.0", + "psutil>=7.1.3,<8.0", "PyYAML>=6.0.3,<7.0", "rich>=13.0.0,<16.0", "art>=5.0,<7.0", @@ -49,9 +49,9 @@ dependencies = [ "requests>=2.32.2,<3.0", "rdkit>=2025.3.4,<2027", "numba>=0.63.0,<0.70", - "dask>=2025.4.0,<2027.1.0", + "dask>=2025.7.0,<2027.1.0", "dask-jobqueue>=0.9.0,<1.0", - "distributed>=2025.4.0,<2027.1.0", + "distributed>=2025.7.0,<2027.1.0", ] [project.urls] From 06ddc7f5c1452e4539252307490379edf28c95d2 Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Wed, 14 Oct 2026 11:01:13 +0100 Subject: [PATCH 5/6] docs: add dependency floors badge to README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6db8d01e..9a2c4107 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ CodeEntropy | Category | Badges | |----------------|--------| -| **Build** | [![PR Checks](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/pr.yaml/badge.svg)](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/pr.yaml) [![Daily Tests](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/daily.yaml/badge.svg)](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/daily.yaml) | +| **Build** | [![PR Checks](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/pr.yaml/badge.svg)](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/pr.yaml) [![Daily Tests](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/daily.yaml/badge.svg)](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/daily.yaml) [![Dependency Floors](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/dependency-floors.yaml/badge.svg)](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/dependency-floors.yaml) | | **Regression** | [![Weekly Regression](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/weekly-regression.yaml/badge.svg)](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/weekly-regression.yaml) | | **Documentation** | [![Weekly Docs](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/weekly-docs.yaml/badge.svg)](https://github.com/CCPBioSim/CodeEntropy/actions/workflows/weekly-docs.yaml) [![Docs - Status](https://app.readthedocs.org/projects/codeentropy/badge/?version=latest)](https://codeentropy.readthedocs.io/en/latest/?badge=latest) | | **Citation** | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17570721.svg)](https://doi.org/10.5281/zenodo.17570721) | From 4fd79656289f5ca0c2b74e3addddcab64bd753af Mon Sep 17 00:00:00 2001 From: harryswift01 Date: Wed, 14 Oct 2026 11:12:59 +0100 Subject: [PATCH 6/6] ci(deps): run lowest-dependency check in the PR unit job --- .github/workflows/dependency-floors.yaml | 4 ---- .github/workflows/pr.yaml | 13 +++++++++++++ docs/developer_guide.rst | 6 +++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dependency-floors.yaml b/.github/workflows/dependency-floors.yaml index 99812ffb..7325abc7 100644 --- a/.github/workflows/dependency-floors.yaml +++ b/.github/workflows/dependency-floors.yaml @@ -1,10 +1,6 @@ name: Dependency Floors on: - pull_request: - paths: - - pyproject.toml - - .github/workflows/dependency-floors.yaml schedule: - cron: '0 8 * * 1' workflow_dispatch: diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index fe5d3e19..3fc599d8 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -38,6 +38,19 @@ jobs: - name: Pytest unit • ${{ matrix.os }}, ${{ matrix.python-version }} run: python -m pytest tests/unit + - name: Install uv + run: python -m pip install uv + + - name: Resolve lowest dependencies as wheels + run: | + uv pip compile pyproject.toml --resolution lowest-direct --only-binary :all: --output-file lowest.txt + + - name: Install lowest dependencies + run: uv pip install --system --reinstall --resolution lowest-direct -e ".[testing]" + + - name: Pytest unit at lowest dependencies • ${{ matrix.os }}, ${{ matrix.python-version }} + run: python -m pytest tests/unit + discover-systems: name: Discover regression systems runs-on: ubuntu-26.04 diff --git a/docs/developer_guide.rst b/docs/developer_guide.rst index 3827bda6..452d911c 100644 --- a/docs/developer_guide.rst +++ b/docs/developer_guide.rst @@ -181,9 +181,9 @@ bound (floor) is the oldest release CodeEntropy is known to work with, so that i stays installable alongside other scientific packages. Floors are only raised when the code needs a newer release. Upper bounds are widened by Renovate. -The ``dependency-floors.yaml`` workflow checks this on pull requests that change -``pyproject.toml`` and weekly. It checks that the lowest allowed versions resolve -to installable wheels on each platform and Python version, and that the unit tests +The unit job in the pull request workflow and the weekly ``dependency-floors.yaml`` +workflow check this. They check that the lowest allowed versions resolve to +installable wheels on each platform and Python version, and that the unit tests pass with them installed. Run the same checks locally with `uv `_::