Skip to content

Commit a5308f5

Browse files
committed
Enable caching and enforce dependency versions in uv workflow
1 parent 0f4671a commit a5308f5

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

β€Ž.github/workflows/uv-test.ymlβ€Ž

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,24 @@ jobs:
1414
os: [ubuntu-latest, windows-latest, macos-latest]
1515
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1616
runs-on: ${{ matrix.os }}
17-
steps:
18-
- name: πŸ“₯ Checkout the repository
19-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
steps:
18+
- name: πŸ“₯ Checkout the repository
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2020

21-
- name: 🐍 Install uv and set Python version ${{ matrix.python-version }}
22-
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
23-
with:
24-
python-version: ${{ matrix.python-version }}
25-
activate-environment: true
21+
- name: 🐍 Install uv and set Python version ${{ matrix.python-version }}
22+
uses: astral-sh/setup-uv@85856786d1ce8acfbcc2f13a5f3fbd6b938f9f41 # v7.1.2
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
activate-environment: true
26+
enable-cache: true # Recommended: caches the uv download/builds
2627

28+
- name: πŸš€ Install Packages
29+
# CHANGED: 'uv sync' enforces the versions in uv.lock
30+
run: uv sync --group dev --group docs --extra metrics
2731

28-
- name: πŸš€ Install Packages
29-
run: uv pip install -r pyproject.toml --group dev --group docs --extra metrics
32+
- name: πŸ§ͺ Run the Import test
33+
# 'uv run' executes inside the environment created by 'uv sync'
34+
run: uv run python -c "import supervision; from supervision import assets; from supervision import metrics; print(supervision.__version__)"
3035

31-
- name: πŸ§ͺ Run the Import test
32-
run: uv run python -c "import supervision; from supervision import assets; from supervision import metrics; print(supervision.__version__)"
33-
34-
- name: πŸ§ͺ Run the Test
35-
run: uv run pytest
36+
- name: πŸ§ͺ Run the Test
37+
run: uv run pytest

0 commit comments

Comments
Β (0)