Skip to content

Commit

Permalink
Replace requirements.lock with uv.lock
Browse files Browse the repository at this point in the history
Similar setup as in aiida-core
  • Loading branch information
agoscinski committed Feb 4, 2025
1 parent 73f14e3 commit 26f6837
Show file tree
Hide file tree
Showing 6 changed files with 1,809 additions and 88 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,20 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install dependencies (including dev dependencies at frozen version)
- name: Set up uv
uses: astral-sh/[email protected]
with:
version: 0.5.22
python-version: ${{ matrix.python-version }}
- name: Install dependencies from uv lock
if: ${{ inputs.from-lock == 'true' }}
# NOTE: We're asserting that the lockfile is up to date
run: uv sync --locked --extra optionaltests
shell: bash
- name: Install disk-objectstore
# I'm using pip install -e to make sure that the coverage properly traces the runs
# also of the concurrent tests (maybe we can achieve this differently)
run: |
python -m pip install --upgrade pip
pip install -e .[optionaltests]
pip install -r requirements.lock
run: uv pip install -e .[optionaltests]
- name: Run benchmarks
run: pytest --benchmark-only --benchmark-json output.json
- name: Store benchmark result
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@ jobs:
run: |
.github/workflows/setup-ssh-localhost.sh
ssh -v localhost
- name: Install dependencies (including dev dependencies at frozen version)
- name: Set up uv
uses: astral-sh/[email protected]
with:
version: 0.5.22
python-version: ${{ matrix.python-version }}
- name: Install dependencies from uv lock
if: ${{ inputs.from-lock == 'true' }}
# NOTE: We're asserting that the lockfile is up to date
run: uv sync --locked --extra progressbar --extra optionaltests
shell: bash
- name: Install disk-objectstore
# I'm using pip install -e to make sure that the coverage properly traces the runs
# also of the concurrent tests (maybe we can achieve this differently)
run: |
python -m pip install --upgrade pip
pip install -e .[progressbar,optionaltests]
pip install -r requirements.lock
run: uv pip install -e .[progressbar, optionaltests]
- name: Test with pytest
# No need to run the benchmarks, they will run in a different workflow
# Also, run in very verbose mode so if there is an error we get a complete diff
Expand Down
17 changes: 12 additions & 5 deletions .github/workflows/concurrency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,20 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies (including dev dependencies at frozen version)
- name: Set up uv
uses: astral-sh/[email protected]
with:
version: 0.5.22
python-version: ${{ matrix.python-version }}
- name: Install dependencies from uv lock
if: ${{ inputs.from-lock == 'true' }}
# NOTE: We're asserting that the lockfile is up to date
run: uv sync --locked --extra optionaltests
shell: bash
- name: Install disk-objectstore
# I'm using pip install -e to make sure that the coverage properly traces the runs
# also of the concurrent tests (maybe we can achieve this differently)
run: |
python -m pip install --upgrade pip
pip install -e .[optionaltests]
pip install -r requirements.lock
run: uv pip install -e .[optionaltests]
- name: Test with pytest
# Run only the concurrency tests, and repeating them 5 times to increase the chance that, if there is an issue
# only happening rarely, we notice it
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,6 @@ commands = pytest {posargs}
description = Run CLI
commands = dostore {posargs}
"""

[tool.uv]
required-version = ">=0.5.21"
73 changes: 0 additions & 73 deletions requirements.lock

This file was deleted.

Loading

0 comments on commit 26f6837

Please sign in to comment.