Skip to content

Commit 37036c9

Browse files
committed
Update workflows to use uv
1 parent de2d357 commit 37036c9

File tree

2 files changed

+51
-35
lines changed

2 files changed

+51
-35
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,32 @@ on:
99
jobs:
1010
test:
1111

12-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
1313
strategy:
1414
fail-fast: false
1515
matrix:
1616
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11"]
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v5
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@v5
2022
- name: Set up Python ${{ matrix.python-version }}
21-
uses: actions/setup-python@v4
23+
uses: actions/setup-python@v6
2224
with:
2325
python-version: ${{ matrix.python-version }}
24-
- name: Install base dependencies
26+
- name: Install Project
2527
run: |
26-
python -m pip install --upgrade pip setuptools wheel
27-
pip install -r requirements-dev.txt
28-
pip install -e .
29-
pip install -e sphinx-plugin
28+
uv sync --frozen --group test --group doc
29+
uv pip install -e sphinx-plugin
3030
- name: Test python-dispatch
3131
run: |
32-
py.test --cov --cov-config=.coveragerc tests pydispatch doc README.md
32+
uv run pytest --cov --cov-config=.coveragerc tests pydispatch doc README.md
3333
- name: Test python-dispatch-sphinx
3434
run: |
35-
py.test --cov --cov-append --cov-config=sphinx-plugin/.coveragerc sphinx-plugin/tests
35+
uv run pytest --cov --cov-append --cov-config=sphinx-plugin/.coveragerc sphinx-plugin/tests
3636
- name: Upload to Coveralls
37-
run: coveralls --service=github
37+
run: uv run coveralls --service=github
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040
COVERALLS_FLAG_NAME: run-${{ matrix.python-version }}

.github/workflows/dist-test.yml

Lines changed: 40 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,58 +19,74 @@ jobs:
1919
build:
2020
runs-on: ubuntu-latest
2121
steps:
22-
- uses: actions/checkout@v2
23-
- name: Set up Python ${{ matrix.python-version }}
24-
uses: actions/setup-python@v2
22+
- uses: actions/checkout@v5
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v5
25+
- name: Set up Python
26+
uses: actions/setup-python@v6
2527
with:
26-
python-version: 3.8
27-
- name: Install dependencies
28-
run: |
29-
python -m pip install --upgrade pip setuptools wheel
28+
python-version: 3.11
3029
- name: Build pydispatch dists
31-
run: python setup.py sdist bdist_wheel
30+
run: uv build
3231
- name: Build pydispatch_sphinx dists
33-
run: python setup.py sdist --dist-dir=$DISTDIR bdist_wheel --dist-dir=$DISTDIR
32+
run: uv build --out-dir $DISTDIR
3433
working-directory: ${{ github.workspace }}/sphinx-plugin
3534
env:
3635
DISTDIR: ${{ github.workspace }}/dist-sphinx
36+
- name: Export pydispatch lockfile
37+
run: uv export --frozen --no-emit-project --only-group test -o pylock.toml
38+
- name: Export pydispatch_sphinx lockfile
39+
run: uv export --frozen --no-emit-project --only-group test -o pylock.toml
40+
working-directory: ${{ github.workspace }}/sphinx-plugin
3741
- name: Upload artifacts
38-
uses: actions/upload-artifact@v2
42+
uses: actions/upload-artifact@v5
3943
with:
4044
name: 'dists'
4145
path: 'dist/*'
4246
- name: Upload sphinx artifacts
43-
uses: actions/upload-artifact@v2
47+
uses: actions/upload-artifact@v5
4448
with:
4549
name: 'dists-sphinx'
4650
path: 'dist-sphinx/*'
51+
- name: Upload lockfiles
52+
uses: actions/upload-artifact@v5
53+
with:
54+
name: 'lockfiles'
55+
path: |
56+
pylock.toml
57+
sphinx-plugin/pylock.toml
4758
4859
test:
4960
needs: build
50-
runs-on: ubuntu-20.04
61+
runs-on: ubuntu-latest
5162
strategy:
5263
matrix:
5364
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11"]
5465
dist-type: [sdist, wheel]
5566
fail-fast: false
5667

5768
steps:
58-
- uses: actions/checkout@v2
69+
- uses: actions/checkout@v5
5970
- name: Set up Python ${{ matrix.python-version }}
60-
uses: actions/setup-python@v4
71+
uses: actions/setup-python@v6
6172
with:
6273
python-version: ${{ matrix.python-version }}
74+
- name: Download lockfiles
75+
uses: actions/download-artifact@v5
76+
with:
77+
name: 'lockfiles'
78+
path: .
6379
- name: Install dependencies
6480
run: |
65-
python -m pip install --upgrade pip setuptools wheel
66-
pip install -r requirements-dev.txt
81+
pip install -r pylock.toml
82+
pip install -r sphinx-plugin/pylock.toml
6783
- name: Download artifacts
68-
uses: actions/download-artifact@v2
84+
uses: actions/download-artifact@v5
6985
with:
7086
name: 'dists'
7187
path: dist
7288
- name: Download sphinx artifacts
73-
uses: actions/download-artifact@v2
89+
uses: actions/download-artifact@v5
7490
with:
7591
name: 'dists-sphinx'
7692
path: dist
@@ -94,21 +110,21 @@ jobs:
94110
if: ${{ success() && (github.event.inputs.allow_deploy == 'true' || github.event.inputs.allow_sphinx_deploy == 'true') }}
95111
runs-on: ubuntu-latest
96112
steps:
97-
- uses: actions/checkout@v2
98-
- name: Set up Python ${{ matrix.python-version }}
99-
uses: actions/setup-python@v2
113+
- uses: actions/checkout@v5
114+
- name: Set up Python
115+
uses: actions/setup-python@v6
100116
with:
101-
python-version: 3.8
117+
python-version: 3.11
102118
- name: Install dependencies
103119
run: |
104120
python -m pip install --upgrade pip setuptools wheel twine
105121
- name: Download artifacts
106-
uses: actions/download-artifact@v2
122+
uses: actions/download-artifact@v5
107123
with:
108124
name: 'dists'
109125
path: dist
110126
- name: Download sphinx artifacts
111-
uses: actions/download-artifact@v2
127+
uses: actions/download-artifact@v5
112128
with:
113129
name: 'dists-sphinx'
114130
path: dist-sphinx

0 commit comments

Comments
 (0)