Skip to content

Commit d05f036

Browse files
Update workflows to use uv
Update Github workflows to use uv … Co-authored-by: Oliver Copping <[email protected]>
1 parent de4c7c8 commit d05f036

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: Install requirements
2-
description: Install a version of python then call pip install and report what was installed
2+
description: Install uv, use it to install dependencies and report what was installed
33
inputs:
44
python-version:
55
description: Python version to install, default is from Dockerfile
66
default: "dev"
7-
pip-install:
8-
description: Parameters to pass to pip install
9-
default: "$([ -f dev-requirements.txt ] && echo '-c dev-requirements.txt') -e .[dev]"
7+
uv-sync:
8+
description: Parameters to pass to uv sync
9+
default: "--locked"
1010

1111
runs:
1212
using: composite
@@ -20,15 +20,17 @@ runs:
2020
echo "PYTHON_VERSION=$PYTHON_VERSION" >> "$GITHUB_ENV"
2121
shell: bash
2222

23-
- name: Setup python
24-
uses: actions/setup-python@v5
23+
- name: Install uv and set the python version
24+
uses: astral-sh/setup-uv@v5
2525
with:
2626
python-version: ${{ env.PYTHON_VERSION }}
27+
enable-cache: true
28+
cache-dependency-glob: "uv.lock"
2729

2830
- name: Install packages
29-
run: pip install ${{ inputs.pip-install }}
31+
run: uv sync ${{ inputs.uv-sync }}
3032
shell: bash
3133

3234
- name: Report what was installed
33-
run: pip freeze
35+
run: uv pip freeze
3436
shell: bash

.github/workflows/_dist.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ jobs:
2727
run: pipx run twine check --strict dist/*
2828

2929
- name: Install produced wheel
30-
uses: ./.github/actions/install_requirements
31-
with:
32-
pip-install: dist/*.whl
30+
run: pipx run pip install dist/*.whl
3331

3432
- name: Test module --version works using the installed wheel
3533
# If more than one module in src/ replace with module name to test

.github/workflows/_release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Create GitHub Release
2424
# We pin to the SHA, not the tag, for security reasons.
2525
# https://docs.github.com/en/actions/learn-github-actions/security-hardening-for-github-actions#using-third-party-actions
26-
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048 # v2.2.0
26+
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2.2.1
2727
with:
2828
prerelease: ${{ contains(github.ref_name, 'a') || contains(github.ref_name, 'b') || contains(github.ref_name, 'rc') }}
2929
files: "*"

.github/workflows/_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
- if: inputs.python-version == 'dev'
3636
name: Write the requirements as an artifact
37-
run: pip freeze --exclude-editable > /tmp/dev-requirements.txt
37+
run: uv pip freeze --exclude-editable > /tmp/dev-requirements.txt
3838

3939
- if: inputs.python-version == 'dev'
4040
name: Upload dev-requirements.txt
@@ -48,7 +48,7 @@ jobs:
4848
uses: ./.github/actions/install_requirements
4949
with:
5050
python-version: ${{ inputs.python-version }}
51-
pip-install: ".[dev]"
51+
uv-sync: ""
5252

5353
- name: Run tests
5454
run: tox -e tests

0 commit comments

Comments
 (0)