Skip to content

Commit

Permalink
Set minimum uv version in pyproject.toml (#6714)
Browse files Browse the repository at this point in the history
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. 🎉
  • Loading branch information
danielhollas authored Jan 16, 2025
1 parent 7387056 commit c88fc05
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/actions/install-aiida-core/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/ci-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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/
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -510,3 +510,6 @@ passenv =
AIIDA_TEST_WORKERS
commands = molecule {posargs:test}
"""

[tool.uv]
required-version = ">=0.5.20"

0 comments on commit c88fc05

Please sign in to comment.