Skip to content

Commit 3acf828

Browse files
committed
Use UV for CI and docs builds
1 parent 859e449 commit 3acf828

8 files changed

Lines changed: 323 additions & 347 deletions

File tree

.github/workflows/ci.yml

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,20 @@ jobs:
2525
- run: SKIP=$(yq '.ci.skip' -o csv .pre-commit-config.yaml) uvx pre-commit run --all-files --show-diff-on-failure
2626
dist:
2727
runs-on: ubuntu-latest
28-
needs: [pre-commit]
2928
steps:
3029
- uses: actions/checkout@v6
31-
- uses: actions/setup-python@v6
30+
- uses: astral-sh/setup-uv@v7
31+
- run: uvx --from build pyproject-build --sdist --wheel
32+
- run: uvx twine check dist/*
33+
- uses: actions/upload-artifact@v6
3234
with:
33-
python-version: "3.x"
34-
cache: 'pip'
35-
cache-dependency-path: '**/pyproject.toml'
36-
- run: python -m pip install --upgrade pip build twine
37-
- run: python -m build --sdist --wheel
38-
- run: python -m twine check dist/*
35+
path: dist/*
3936
docs:
4037
runs-on: ubuntu-latest
41-
needs: [pre-commit]
4238
steps:
4339
- uses: actions/checkout@v6
44-
- name: setup Python
45-
uses: actions/setup-python@v6
46-
with:
47-
python-version: "3.10"
48-
cache: 'pip'
49-
cache-dependency-path: '**/pyproject.toml'
50-
- run: python -m pip install -e .[docs]
51-
- run: python -m sphinx -b html -W docs docs/_build
40+
- uses: astral-sh/setup-uv@v7
41+
- run: uv run --group docs sphinx-build -W -b doctest -b html docs docs/_build
5242
PyTest:
5343
runs-on: ubuntu-latest
5444
needs: [pre-commit]
@@ -68,13 +58,11 @@ jobs:
6858
django-version: "5.2"
6959
steps:
7060
- uses: actions/checkout@v6
71-
- name: Setup Python version ${{ matrix.python-version }}
72-
uses: actions/setup-python@v6
61+
- uses: astral-sh/setup-uv@v7
7362
with:
7463
python-version: ${{ matrix.python-version }}
75-
cache: 'pip'
76-
cache-dependency-path: '**/pyproject.toml'
77-
- run: python -m pip install .[test]
78-
- run: python -m pip install Django~="${{ matrix.django-version }}.0"
79-
- run: python -m pytest
80-
- uses: codecov/codecov-action@v3
64+
- run: uv run --with Django~=${{ matrix.django-version }}.0 pytest
65+
- uses: codecov/codecov-action@v5
66+
with:
67+
token: ${{ secrets.CODECOV_TOKEN }}
68+
flags: python-${{ matrix.python-version }}-django-${{ matrix.django-version }}

.github/workflows/release.yml

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,21 @@ on:
33
release:
44
types: [published]
55
workflow_dispatch:
6-
permissions:
7-
id-token: write
86
jobs:
9-
release-build:
7+
pypi-build:
108
runs-on: ubuntu-latest
119
steps:
1210
- uses: actions/checkout@v6
13-
- uses: actions/setup-python@v6
14-
with:
15-
python-version: "3.x"
16-
- run: python -m pip install --upgrade pip build
17-
- run: python -m build --sdist --wheel
11+
- uses: astral-sh/setup-uv@v7
12+
- run: uvx --from build pyproject-build --sdist --wheel
1813
- uses: actions/upload-artifact@v6
1914
with:
2015
name: release-dists
2116
path: dist/
2217
pypi-publish:
2318
runs-on: ubuntu-latest
2419
needs:
25-
- release-build
20+
- pypi-build
2621
permissions:
2722
id-token: write
2823
steps:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,6 @@ ENV/
112112

113113
# SCM
114114
_version.py
115+
116+
# uv
117+
uv.lock

.readthedocs.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@
33
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
44
version: 2
55
build:
6-
os: ubuntu-20.04
6+
os: ubuntu-24.04
77
tools:
8-
python: "3.10"
9-
sphinx:
10-
configuration: docs/conf.py
11-
python:
12-
install:
13-
- method: pip
14-
path: .
15-
extra_requirements:
16-
- docs
8+
python: "3"
9+
jobs:
10+
install:
11+
- curl -LsSf https://astral.sh/uv/install.sh | sh
12+
build:
13+
html:
14+
- $HOME/.local/bin/uv run --group docs sphinx-build -b html docs $READTHEDOCS_OUTPUT/html

docs/conf.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,2 @@
1-
try:
2-
import sphinx_rtd_theme
3-
except ImportError:
4-
sphinx_rtd_theme = None
5-
61
master_doc = "index"
7-
8-
if sphinx_rtd_theme:
9-
html_theme = "sphinx_rtd_theme"
10-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
2+
html_theme = "furo"

0 commit comments

Comments
 (0)