Skip to content

Commit

Permalink
CI: Use uv's resolution=lowest strategy in one of the jobs (#95)
Browse files Browse the repository at this point in the history
Instead of manually specifying the lowest supported aiida-core
version in CI specification, we can use the uv's resolution algorithm
to test with the lowest supported versions of the dependencies.

* CI: Use uv's resolution=lowest strategy in one of the jobs
* Add minimum versions for pytest-datadir and pytest-mock
* Update uv version
  • Loading branch information
danielhollas authored Jan 5, 2025
1 parent 391a7df commit e2cb3d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main
pull_request:
env:
UV_VER: "0.5.6"
UV_VER: "0.5.14"
FORCE_COLOR: 1

jobs:
Expand All @@ -17,11 +17,13 @@ jobs:
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
aiida-version-spec: ['>=2.5']
# Include a job with minimum supported aiida-version
resolution: ['highest']
# Include a job with minimum supported aiida-version,
# achieved via uv's resolution strategy, see:
# https://docs.astral.sh/uv/reference/settings/#resolution
include:
- python-version: '3.9'
aiida-version-spec: '==2.1'
resolution: 'lowest-direct'
fail-fast: false

services:
Expand Down Expand Up @@ -51,11 +53,11 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Set up uv
uses: astral-sh/setup-uv@v4
uses: astral-sh/setup-uv@v5
with:
version: ${{ env.UV_VER }}
- name: Install package
run: uv pip install --system -e .[tests] "aiida-core${{ matrix.aiida-version-spec }}"
run: uv pip install --resolution ${{ matrix.resolution }} --system -e .[tests]

- name: Run test suite
env:
Expand Down Expand Up @@ -85,7 +87,7 @@ jobs:
python-version: '3.12'

- name: Set up uv
uses: astral-sh/setup-uv@v4
uses: astral-sh/setup-uv@v5
with:
version: ${{ env.UV_VER }}

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ docs = ["sphinx", "sphinx-rtd-theme"]
tests = [
"pgtest~=1.3.1",
"aiida-diff~=2.0.0",
"pytest-datadir",
"pytest-mock",
"pytest-datadir~=1.4",
"pytest-mock~=3.11",
"pytest-cov>=4.0",
]
pre_commit = [
Expand Down

0 comments on commit e2cb3d7

Please sign in to comment.