Skip to content

Commit c97aeb2

Browse files
committed
Use UV in CI suite
1 parent 49a76fd commit c97aeb2

File tree

4 files changed

+34
-43
lines changed

4 files changed

+34
-43
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,20 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v6
12-
- uses: actions/setup-python@v6
13-
with:
14-
python-version: "3.x"
1512
- run: sudo apt-get update && sudo apt-get install -y gettext
16-
- name: Install Python dependencies
17-
run: python -m pip install --upgrade pip build wheel twine readme-renderer
18-
- run: python -m build --sdist --wheel
19-
- run: python -m twine check dist/*
13+
- uses: astral-sh/setup-uv@v7
14+
- run: uvx --from build pyproject-build --sdist --wheel
15+
- run: uvx twine check dist/*
2016
- uses: actions/upload-artifact@v6
2117
with:
2218
path: dist/*
2319
docs:
2420
runs-on: ubuntu-latest
2521
steps:
2622
- uses: actions/checkout@v6
27-
- uses: actions/setup-python@v6
28-
with:
29-
python-version: "3.11"
3023
- run: sudo apt-get update && sudo apt-get install -y gettext
31-
- run: python -m pip install -e '.[docs]'
32-
- run: python -m mkdocs build --strict
24+
- uses: astral-sh/setup-uv@v7
25+
- run: uv run mkdocs build --strict
3326
SQLite:
3427
needs: [dist, docs]
3528
runs-on: ubuntu-latest
@@ -54,13 +47,11 @@ jobs:
5447
django-version: "6.0"
5548
steps:
5649
- uses: actions/checkout@v6
57-
- uses: actions/setup-python@v6
50+
- run: sudo apt-get update && sudo apt-get install -y gettext
51+
- uses: astral-sh/setup-uv@v7
5852
with:
5953
python-version: ${{ matrix.python-version }}
60-
- run: sudo apt-get update && sudo apt-get install -y gettext
61-
- run: python -m pip install -e '.[test]'
62-
- run: python -m pip install Django~=${{ matrix.django-version }}.0
63-
- run: python -m pytest
54+
- run: uv run --with django~=${{ matrix.django-version }}.0 pytest
6455
- uses: codecov/codecov-action@v5
6556
with:
6657
token: ${{ secrets.CODECOV_TOKEN }}
@@ -78,24 +69,18 @@ jobs:
7869
- "7.2"
7970
steps:
8071
- uses: actions/checkout@v6
81-
- name: Set up Python ${{ matrix.python-version }}
82-
uses: actions/setup-python@v6
72+
- run: sudo apt-get update && sudo apt-get install -y gettext
73+
- uses: astral-sh/setup-uv@v7
8374
with:
8475
python-version: ${{ matrix.python-version }}
85-
- run: sudo apt-get update && sudo apt-get install -y gettext
86-
- run: python -m pip install -e ".[test,wagtail]"
87-
- run: python -m pip install wagtail~=${{ matrix.wagtail-version }}.0
88-
- run: python -m pytest
76+
- run: uv run --extra wagtail --with wagtail~=${{ matrix.wagtail-version }}.0 pytest
8977
- uses: codecov/codecov-action@v5
9078
with:
9179
token: ${{ secrets.CODECOV_TOKEN }}
9280
flags: ${{ matrix.extras }}
9381
PostgreSQL:
9482
needs: [dist, docs]
9583
runs-on: ubuntu-latest
96-
strategy:
97-
matrix:
98-
python-version: ["3.x"]
9984
services:
10085
postgres:
10186
image: postgres
@@ -106,13 +91,10 @@ jobs:
10691
- 5432/tcp
10792
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
10893
steps:
109-
- name: Set up Python ${{ matrix.python-version }}
110-
uses: actions/setup-python@v6
111-
with:
112-
python-version: ${{ matrix.python-version }}
11394
- uses: actions/checkout@v6
11495
- run: sudo apt-get update && sudo apt-get install -y gettext
115-
- run: python -m pip install -e ".[test,postgres]"
96+
- uses: astral-sh/setup-uv@v7
97+
- run: uv run --extra prosgres pytest
11698
- run: psql template1 -c "CREATE EXTENSION citext;"
11799
env:
118100
PGHOST: localhost

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ target/
6060
# mkdocs documentation
6161
/site/
6262

63+
# UV
64+
uv.lock
65+
6366
tests/local.py
6467
docs/_build/
6568
venv

.readthedocs.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ build:
88
python: "3"
99
apt_packages:
1010
- gettext
11-
python:
12-
install:
13-
- method: pip
14-
path: .
15-
extra_requirements:
16-
- docs
11+
jobs:
12+
install:
13+
- curl -LsSf https://astral.sh/uv/install.sh | sh
14+
build:
15+
html:
16+
- uv run mkdocs build
1717
mkdocs:
1818
configuration: mkdocs.yml

pyproject.toml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,18 @@ dependencies = [
4848
]
4949

5050
[project.optional-dependencies]
51+
wagtail = [
52+
"wagtail>=6.3",
53+
]
54+
postgres = [
55+
"django-citext",
56+
]
57+
58+
[dependency-groups]
59+
dev = [
60+
{ include-group = "test" },
61+
{ include-group = "docs" },
62+
]
5163
test = [
5264
"pytest",
5365
"pytest-cov",
@@ -60,12 +72,6 @@ docs = [
6072
"markdown-callouts",
6173
"Pygments",
6274
]
63-
wagtail = [
64-
"wagtail>=6.3",
65-
]
66-
postgres = [
67-
"django-citext",
68-
]
6975

7076
[project.urls]
7177
Project-URL = "https://github.com/codingjoe/django-mail-auth"

0 commit comments

Comments
 (0)