Skip to content

Commit a6adf93

Browse files
committed
Use uv instead of pip across shared workflows
- prepare_release and tag_release install praw-release via 'uv tool install' from the pinned archive; uv provisions Python 3.14 for the tool venv (praw-release now requires it) so setup-python is dropped. - tag_release's prerelease probe runs via 'uv run --with packaging'. - ci, pre-commit_autoupdate, and set_active_docs keep setup-python for interpreters but install dependencies with 'uv pip install --system' (cache: pip dropped along with pip itself). - lint runs zizmor via uvx instead of pipx.
1 parent 3294d30 commit a6adf93

6 files changed

Lines changed: 19 additions & 34 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ jobs:
88
persist-credentials: false
99
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1010
with:
11-
cache: pip
1211
python-version: 3.x
12+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
1313
- name: Install dependencies
14-
run: |
15-
python -m pip install --upgrade pip setuptools wheel
16-
pip install ".[lint]"
14+
run: uv pip install --system ".[lint]"
1715
- name: Run pre-commit hooks
1816
env:
1917
SKIP: no-commit-to-branch
@@ -33,12 +31,10 @@ jobs:
3331
persist-credentials: false
3432
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
3533
with:
36-
cache: pip
3734
python-version: 3.x
35+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
3836
- name: Install dependencies
39-
run: |
40-
python -m pip install --upgrade pip
41-
pip install ".[test]"
37+
run: uv pip install --system ".[test]"
4238
- name: Test with pytest
4339
env:
4440
ENSURE_NO_UNUSED_CASSETTES: 1
@@ -55,12 +51,10 @@ jobs:
5551
persist-credentials: false
5652
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5753
with:
58-
cache: pip
5954
python-version: ${{ matrix.python-version }}
55+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
6056
- name: Install dependencies
61-
run: |
62-
python -m pip install --upgrade pip
63-
pip install ".[test]" coverage
57+
run: uv pip install --system ".[test]" coverage
6458
- name: Test with pytest
6559
run: coverage run --source "$PACKAGE" --module pytest
6660
env:
@@ -81,12 +75,10 @@ jobs:
8175
persist-credentials: false
8276
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
8377
with:
84-
cache: pip
8578
python-version: 3.x
79+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
8680
- name: Install dependencies
87-
run: |
88-
python -m pip install --upgrade pip
89-
pip install ".[test]"
81+
run: uv pip install --system ".[test]"
9082
- name: Run network test
9183
run: pytest tests/integration/test_github_actions.py::test_github_actions
9284
env:

.github/workflows/lint.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ jobs:
1818
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1919
with:
2020
persist-credentials: false
21+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
2122
- name: Run zizmor
22-
run: pipx run zizmor==1.25.2 .github/workflows/
23+
run: uvx zizmor==1.25.2 .github/workflows/
2324
name: Lint workflows
2425
on:
2526
pull_request:

.github/workflows/pre-commit_autoupdate.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ jobs:
1616
persist-credentials: false
1717
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1818
with:
19-
cache: pip
2019
python-version: 3.x
20+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
2121
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip pre-commit
24-
pip install ".[dev]"
22+
run: uv pip install --system pre-commit ".[dev]"
2523
- name: Update hooks
2624
run: pre-commit autoupdate --freeze
2725
- name: Run hooks

.github/workflows/prepare_release.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,9 @@ jobs:
1515
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
1616
with:
1717
persist-credentials: false
18-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
19-
with:
20-
cache: pip
21-
python-version: 3.x
18+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
2219
- name: Install dependencies
23-
run: pip install https://github.com/praw-dev/praw-release/archive/c4280cc9130ab84d4f51dd4b14209ae2d5f3a23c.zip # v1.1.0
20+
run: uv tool install "praw-release @ https://github.com/praw-dev/praw-release/archive/c4280cc9130ab84d4f51dd4b14209ae2d5f3a23c.zip" # v1.1.0
2421
- name: Prepare Git Variables
2522
run: |
2623
git config --global author.email "$GITHUB_ACTOR@users.noreply.github.com"

.github/workflows/set_active_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ jobs:
88
persist-credentials: false
99
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
1010
with:
11-
cache: pip
1211
python-version: 3.x
12+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
1313
- name: Install dependencies
14-
run: pip install packaging requests
14+
run: uv pip install --system packaging requests
1515
- env:
1616
READTHEDOCS_TOKEN: ${{ secrets.READTHEDOCS_TOKEN }}
1717
name: Set Active Docs

.github/workflows/tag_release.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,16 @@ jobs:
88
with:
99
fetch-depth: 3
1010
persist-credentials: false
11-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
12-
with:
13-
cache: pip
14-
python-version: 3.x
11+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
1512
- name: Install dependencies
16-
run: pip install https://github.com/praw-dev/praw-release/archive/c4280cc9130ab84d4f51dd4b14209ae2d5f3a23c.zip # v1.1.0
13+
run: uv tool install "praw-release @ https://github.com/praw-dev/praw-release/archive/c4280cc9130ab84d4f51dd4b14209ae2d5f3a23c.zip" # v1.1.0
1714
- name: Extract Version
1815
run: |
1916
git checkout HEAD^2^
2017
echo "commit=$(git rev-parse HEAD)" >> "$GITHUB_ENV"
2118
git log --format=%B -n 1 | praw-release extract-version > tmp_version
2219
echo "version=$(cat tmp_version)" >> "$GITHUB_ENV"
23-
cat tmp_version | python -c 'import sys; from packaging import version; print(int(version.Version(sys.stdin.readline()).is_prerelease))' > tmp_is_prerelease
20+
cat tmp_version | uv run --no-project --with packaging python -c 'import sys; from packaging import version; print(int(version.Version(sys.stdin.readline()).is_prerelease))' > tmp_is_prerelease
2421
echo "is_prerelease=$(cat tmp_is_prerelease)" >> "$GITHUB_ENV"
2522
- name: Extract Change Log
2623
run: praw-release changes "$version" > version_changelog

0 commit comments

Comments
 (0)