Skip to content

Commit f5ba2aa

Browse files
authored
Merge pull request #458 from CCPBioSim/457-feature-monitor-dependency-lower-bounds-in-ci
Add dependency floor checks and generate conda recipe dependencies from `pyproject.toml`
2 parents 7745ef8 + 4fd7965 commit f5ba2aa

6 files changed

Lines changed: 105 additions & 21 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Dependency Floors
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * 1'
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: dependency-floors-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
lowest:
17+
name: Lowest dependencies (${{ matrix.os }}, py${{ matrix.python-version }})
18+
runs-on: ${{ matrix.os }}
19+
timeout-minutes: 30
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ubuntu-26.04, macos-26, windows-2025-vs2026]
25+
python-version: ["3.12", "3.13", "3.14"]
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30+
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
36+
- name: Install uv
37+
run: |
38+
python -m pip install --upgrade pip
39+
python -m pip install uv
40+
41+
- name: Resolve lowest dependencies as wheels
42+
run: |
43+
uv pip compile pyproject.toml --resolution lowest-direct --only-binary :all: --output-file lowest.txt
44+
cat lowest.txt
45+
46+
- name: Install lowest dependencies
47+
run: uv pip install --system --resolution lowest-direct -e ".[testing]"
48+
49+
- name: Run unit tests
50+
run: python -m pytest tests/unit

‎.github/workflows/pr.yaml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ jobs:
3838
- name: Pytest unit • ${{ matrix.os }}, ${{ matrix.python-version }}
3939
run: python -m pytest tests/unit
4040

41+
- name: Install uv
42+
run: python -m pip install uv
43+
44+
- name: Resolve lowest dependencies as wheels
45+
run: |
46+
uv pip compile pyproject.toml --resolution lowest-direct --only-binary :all: --output-file lowest.txt
47+
48+
- name: Install lowest dependencies
49+
run: uv pip install --system --reinstall --resolution lowest-direct -e ".[testing]"
50+
51+
- name: Pytest unit at lowest dependencies • ${{ matrix.os }}, ${{ matrix.python-version }}
52+
run: python -m pytest tests/unit
53+
4154
discover-systems:
4255
name: Discover regression systems
4356
runs-on: ubuntu-26.04

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ CodeEntropy
33

44
| Category | Badges |
55
|----------------|--------|
6-
| **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) |
6+
| **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) |
77
| **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) |
88
| **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) |
99
| **Citation** | [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17570721.svg)](https://doi.org/10.5281/zenodo.17570721) |

‎conda-recipe/meta.yaml‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{% set name = "codeentropy" %}
22
{% set version = "0.0.0" %}
3+
{% set pyproject = load_file_data("../pyproject.toml", from_recipe_dir=True) %}
4+
{% set pip_only = namespace(water_entropy="") %}
5+
{% for dependency in pyproject["project"]["dependencies"] %}
6+
{% if dependency.startswith("waterEntropy") %}
7+
{% set pip_only.water_entropy = dependency %}
8+
{% endif %}
9+
{% endfor %}
310

411
package:
512
name: {{ name }}
@@ -12,7 +19,7 @@ build:
1219
noarch: python
1320
script: |
1421
python -m pip install . -vv --no-deps
15-
PIP_NO_INDEX=0 python -m pip install -vv --index-url https://pypi.org/simple "waterEntropy>=2,<3.0"
22+
PIP_NO_INDEX=0 python -m pip install -vv --index-url https://pypi.org/simple "{{ pip_only.water_entropy }}"
1623
entry_points:
1724
- CodeEntropy=CodeEntropy.cli:main
1825

@@ -22,21 +29,14 @@ requirements:
2229
- pip
2330
- flit-core >=4,<5
2431
run:
25-
- python >=3.12
26-
- numpy >=2.3.2,<2.5.0
27-
- mdanalysis >=2.10,<3.0
28-
- pandas >=2.3.3,<4.0
29-
- psutil >=5.9.4,<8.0
30-
- pyyaml >=6.0.3,<7.0
31-
- rich >=13.0.0,<16.0
32-
- python-art >=5.0,<7.0
33-
- networkx >=2.8,<4.0
34-
- requests >=2.32.2,<3.0
35-
- rdkit >=2025.3.4,<2026
36-
- dask >=2025.4.0,<2027.1.0
37-
- distributed >=2025.4.0,<2027.1.0
38-
- dask-jobqueue >=0.9.0,<1.0
39-
- numba >=0.63.0,<0.70
32+
- python {{ pyproject["project"]["requires-python"] }}
33+
{% for dependency in pyproject["project"]["dependencies"] %}
34+
{% if dependency.startswith("art>") %}
35+
- python-{{ dependency }}
36+
{% elif not dependency.startswith("waterEntropy") %}
37+
- {{ dependency | lower }}
38+
{% endif %}
39+
{% endfor %}
4040

4141
test:
4242
imports:

‎docs/developer_guide.rst‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,30 @@ Weekly workflows:
167167

168168
- Full regression suite including slow tests
169169
- Documentation build across all Python versions
170+
- Dependency floor checks (see :ref:`dependency-policy`)
170171

171172
CI also caches regression datasets to improve performance.
172173

174+
.. _dependency-policy:
175+
176+
Dependency Policy
177+
-----------------
178+
179+
Runtime dependencies in ``pyproject.toml`` are declared as ranges. The lower
180+
bound (floor) is the oldest release CodeEntropy is known to work with, so that it
181+
stays installable alongside other scientific packages. Floors are only raised
182+
when the code needs a newer release. Upper bounds are widened by Renovate.
183+
184+
The unit job in the pull request workflow and the weekly ``dependency-floors.yaml``
185+
workflow check this. They check that the lowest allowed versions resolve to
186+
installable wheels on each platform and Python version, and that the unit tests
187+
pass with them installed.
188+
189+
Run the same checks locally with `uv <https://docs.astral.sh/uv/>`_::
190+
191+
uv pip install --resolution lowest-direct -e ".[testing]"
192+
python -m pytest tests/unit
193+
173194
Building Documentation
174195
----------------------
175196

‎pyproject.toml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ classifiers = [
3737
keywords = ["entropy", "macromolecular systems", "MD simulation"]
3838
requires-python = ">=3.12"
3939
dependencies = [
40-
"numpy>=2.3.2,<2.6.0",
40+
"numpy>=2.3.5,<2.6.0",
4141
"mdanalysis>=2.10,<3.0",
4242
"pandas>=2.3.3,<4.0",
43-
"psutil>=5.9.4,<8.0",
43+
"psutil>=7.1.3,<8.0",
4444
"PyYAML>=6.0.3,<7.0",
4545
"rich>=13.0.0,<16.0",
4646
"art>=5.0,<7.0",
@@ -49,9 +49,9 @@ dependencies = [
4949
"requests>=2.32.2,<3.0",
5050
"rdkit>=2025.3.4,<2027",
5151
"numba>=0.63.0,<0.70",
52-
"dask>=2025.4.0,<2027.1.0",
52+
"dask>=2025.7.0,<2027.1.0",
5353
"dask-jobqueue>=0.9.0,<1.0",
54-
"distributed>=2025.4.0,<2027.1.0",
54+
"distributed>=2025.7.0,<2027.1.0",
5555
]
5656

5757
[project.urls]

0 commit comments

Comments
 (0)