From c88fc05ba111f82e089553e5413b2c7c4d482f6f Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Thu, 16 Jan 2025 15:10:03 +0000 Subject: [PATCH] Set minimum uv version in pyproject.toml (#6714) Closes #6712 This sets the minimum uv version pyproject.toml, which is needed to have a consistent lockfile. When a dev has an outdated uv version, they'll get an error ``` error: Required version `>=0.5.20` does not match the running version `0.5.19` ``` Also pinned the `setup-uv` action to a specific version to prevent accidental regressions since that action is still undergoing heavy development. The new 5.2.0 also allows us to drop a VIRTUAL_ENV workaround. :tada: --- .github/actions/install-aiida-core/action.yml | 2 +- .github/workflows/ci-code.yml | 3 --- .github/workflows/test-install.yml | 5 +---- pyproject.toml | 3 +++ 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/actions/install-aiida-core/action.yml b/.github/actions/install-aiida-core/action.yml index 26e6cac961..e7643f7285 100644 --- a/.github/actions/install-aiida-core/action.yml +++ b/.github/actions/install-aiida-core/action.yml @@ -31,7 +31,7 @@ runs: python-version: ${{ inputs.python-version }} - name: Set up uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v5.2.0 with: version: 0.5.x python-version: ${{ inputs.python-version }} diff --git a/.github/workflows/ci-code.yml b/.github/workflows/ci-code.yml index 2281c39f91..b1482df81f 100644 --- a/.github/workflows/ci-code.yml +++ b/.github/workflows/ci-code.yml @@ -76,10 +76,7 @@ jobs: AIIDA_WARN_v3: 1 # NOTE1: Python 3.12 has a performance regression when running with code coverage # so run code coverage only for python 3.9. - # TODO: Remove a workaround for VIRTUAL_ENV once the setup-uv action is updated - # https://github.com/astral-sh/setup-uv/issues/219 run: | - ${{ matrix.python-version == '3.9' && 'VIRTUAL_ENV=$PWD/.venv' || '' }} pytest -n auto --db-backend ${{ matrix.database-backend }} -m 'not nightly' tests/ ${{ matrix.python-version == '3.9' && '--cov aiida' || '' }} - name: Upload coverage report diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 1ae3de6bd9..372a9332ef 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -38,7 +38,7 @@ jobs: python-version: '3.11' - name: Set up uv - uses: astral-sh/setup-uv@v5 + uses: astral-sh/setup-uv@v5.2.0 with: version: 0.5.x @@ -211,8 +211,5 @@ jobs: env: AIIDA_TEST_PROFILE: test_aiida AIIDA_WARN_v3: 1 - # TODO: Remove a workaround for VIRTUAL_ENV once the setup-uv action is updated - # https://github.com/astral-sh/setup-uv/issues/219 run: | - ${{ matrix.python-version == '3.9' && 'VIRTUAL_ENV=$PWD/.venv' || '' }} pytest -n auto --db-backend psql -m 'not nightly' tests/ diff --git a/pyproject.toml b/pyproject.toml index 6cca60defd..4ee43b8c01 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -510,3 +510,6 @@ passenv = AIIDA_TEST_WORKERS commands = molecule {posargs:test} """ + +[tool.uv] +required-version = ">=0.5.20"