File tree Expand file tree Collapse file tree
actions/install_requirements Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11name : 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
33inputs :
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
1111runs :
1212 using : composite
@@ -21,15 +21,17 @@ runs:
2121 echo "PYTHON_VERSION=$PYTHON_VERSION" >> "$GITHUB_ENV"
2222 shell : bash
2323
24- - name : Setup python
25- uses : actions /setup-python @v5
24+ - name : Install uv and set the python version
25+ uses : astral-sh /setup-uv @v5
2626 with :
2727 python-version : ${{ env.PYTHON_VERSION }}
28+ enable-cache : true
29+ cache-dependency-glob : " uv.lock"
2830
2931 - name : Install packages
30- run : pip install ${{ inputs.pip-install }}
32+ run : uv sync ${{ inputs.uv-sync }}
3133 shell : bash
3234
3335 - name : Report what was installed
34- run : pip freeze
36+ run : uv pip freeze
3537 shell : bash
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
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
You can’t perform that action at this time.
0 commit comments