Skip to content

Commit 9076b40

Browse files
committed
ci(deps): add dependency floor checks
1 parent 7745ef8 commit 9076b40

2 files changed

Lines changed: 75 additions & 0 deletions

File tree

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

‎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 ``dependency-floors.yaml`` workflow checks this on pull requests that change
185+
``pyproject.toml`` and weekly. It checks that the lowest allowed versions resolve
186+
to 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

0 commit comments

Comments
 (0)