From ab3d92f9c22a411afd3a23c99ad273d04eb61100 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Fri, 10 Jan 2025 17:48:35 +0100 Subject: [PATCH 1/2] Use uv-pre-commit to validate lockfile There are two big advantages here: 1. Devs to have to have uv installed globally 2. We control uv version automatically. --- .github/workflows/test-install.yml | 3 --- .pre-commit-config.yaml | 20 +++++++------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index 372a9332e..cd0d75da7 100644 --- a/.github/workflows/test-install.yml +++ b/.github/workflows/test-install.yml @@ -45,9 +45,6 @@ jobs: - name: Install utils/ dependencies run: uv pip install --system -r utils/requirements.txt - - name: Validate uv lockfile - run: uv lock --check - - name: Validate conda environment file run: python ./utils/dependency_management.py validate-environment-yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fb2019ac2..5dbb778b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,7 +2,7 @@ ci: autofix_prs: true autoupdate_commit_msg: 'Devops: Update pre-commit dependencies' autoupdate_schedule: quarterly - skip: [mypy, check-uv-lock, generate-conda-environment, validate-conda-environment, verdi-autodocs] + skip: [mypy, generate-conda-environment, validate-conda-environment, verdi-autodocs] repos: - repo: https://github.com/pre-commit/pre-commit-hooks @@ -56,6 +56,12 @@ repos: environment.yml| )$ +- repo: https://github.com/astral-sh/uv-pre-commit + rev: 0.5.20 + hooks: + # Check and update the uv lockfile + - id: uv-lock + - repo: local hooks: @@ -187,18 +193,6 @@ repos: src/aiida/workflows/arithmetic/multiply_add.py| )$ - - id: check-uv-lock - name: Check uv lockfile up to date - # NOTE: This will not automatically update the lockfile - entry: uv lock --check - language: system - pass_filenames: false - files: >- - (?x)^( - pyproject.toml| - uv.lock| - )$ - - id: generate-conda-environment name: Update conda environment file entry: python ./utils/dependency_management.py generate-environment-yml From 7d778999e451c8b351d9148306d6f4df127480b8 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Thu, 16 Jan 2025 17:55:18 +0000 Subject: [PATCH 2/2] Bump setup-uv action to 5.2.1 --- .github/actions/install-aiida-core/action.yml | 2 +- .github/workflows/test-install.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-aiida-core/action.yml b/.github/actions/install-aiida-core/action.yml index e7643f728..00af79913 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.2.0 + uses: astral-sh/setup-uv@v5.2.1 with: version: 0.5.x python-version: ${{ inputs.python-version }} diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml index cd0d75da7..51c8f04c8 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.2.0 + uses: astral-sh/setup-uv@v5.2.1 with: version: 0.5.x