-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathaction.yml
More file actions
39 lines (35 loc) · 1.42 KB
/
Copy pathaction.yml
File metadata and controls
39 lines (35 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Setup python
description: Setup python and install dependencies
inputs:
python-version:
description: "Python version (e.g. '3.7', '3.8.13', '3.11.0-alpha.1', '3.x')."
required: true
requirements:
description: "Optional list of arguments passed to `uv pip install` (e.g. 'numpy==1.19.5', '-r requirements.txt')."
required: false
runs:
using: composite
steps:
# Install uv together with a uv-managed Python interpreter, and
# create and activate a virtual environment that is used by all
# subsequent steps (e.g. the `uv pip install` step below installs
# into it). Also enables uv's built-in cache. The cache key takes
# the platform, the uv version, and a hash of the files below
# into account.
# See https://docs.astral.sh/uv/guides/integration/github/ for details.
# NOTE: setup-uv publishes immutable releases only (no
# floating major tags), so we pin the full version
- name: Install uv and python
uses: astral-sh/setup-uv@v9.0.0
with:
python-version: "${{ inputs.python-version }}"
activate-environment: true
enable-cache: true
cache-suffix: "py${{ inputs.python-version }}"
cache-dependency-glob: |
pyproject.toml
requirements/*.txt
- name: Install requirements
if: ${{ inputs.requirements != '' }}
shell: bash
run: uv pip install --verbose ${{ inputs.requirements }}