From e2cb3d7ec885485a0e61b50cbd99e794d67a9112 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Sun, 5 Jan 2025 14:35:11 +0100 Subject: [PATCH] CI: Use uv's resolution=lowest strategy in one of the jobs (#95) 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 --- .github/workflows/ci.yml | 16 +++++++++------- pyproject.toml | 4 ++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5cf58c4..22dde4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,7 @@ on: - main pull_request: env: - UV_VER: "0.5.6" + UV_VER: "0.5.14" FORCE_COLOR: 1 jobs: @@ -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: @@ -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: @@ -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 }} diff --git a/pyproject.toml b/pyproject.toml index e923cda..6e29606 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [