Skip to content

Commit

Permalink
CI: Update uv
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed Dec 29, 2024
1 parent b28f5a1 commit 8e66b24
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
19 changes: 10 additions & 9 deletions .github/actions/install-aiida-core/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ inputs:
default: '3.9' # Lowest supported version
required: false
extras:
description: aiida-core extras (including brackets)
default: ''
description: list of optional dependencies
# NOTE: The default 'pre-commit' extra recursively contains
# other extras needed to run the tests.
default: pre-commit
required: false
# NOTE: Hard-learned lesson: we cannot use type=boolean here, apparently :-(
# https://stackoverflow.com/a/76294014
# NOTE2: When installing from lockfile, aiida-core and its dependencies
# are installed in a virtual environment located in .venv directory.
# Subsuquent jobs steps must either activate the environment or use `uv run`
from-lock:
description: Install aiida-core dependencies from a uv lock file
description: Install aiida-core dependencies from uv lock file
default: 'true'
required: false

Expand All @@ -29,19 +31,18 @@ runs:
python-version: ${{ inputs.python-version }}

- name: Set up uv
uses: astral-sh/setup-uv@v4
uses: astral-sh/setup-uv@v5
with:
version: 0.5.6
version: 0.5.x
python-version: ${{ inputs.python-version }}

- name: Install dependencies from uv lock
if: ${{ inputs.from-lock == 'true' }}
# NOTE: We're asserting that the lockfile is up to date
# NOTE2: 'pre-commit' extra recursively contains other extras
# needed to run the tests.
run: uv sync --locked --extra pre-commit
run: uv sync --locked --extra ${{ inputs.extras }}
shell: bash

- name: Install aiida-core
if: ${{ inputs.from-lock != 'true' }}
run: uv pip install --system -e .${{ inputs.extras }}
run: uv pip install -e .${{ inputs.extras }}
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
run: uv pip install --system -r utils/requirements.txt

- name: Validate uv lockfile
run: uv lock --locked
run: uv lock --check

- name: Validate conda environment file
run: python ./utils/dependency_management.py validate-environment-yml
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,13 @@ repos:
- id: check-uv-lock
name: Check uv lockfile up to date
# NOTE: This will not automatically update the lockfile
entry: uv lock --locked
entry: uv lock --check
language: system
pass_filenames: false
files: >-
(?x)^(
pyproject.toml|
uv.lock|
)$
- id: generate-conda-environment
Expand Down

0 comments on commit 8e66b24

Please sign in to comment.