Skip to content

Commit 6abc1f7

Browse files
authored
Update release documentation, workflow and build-and-check job to uv (#2846)
Update release documentation, workflow and build-and-check test to `uv` Aligns `django-stubs` with the changes I have been making in `djangorestframework-stubs`.
1 parent 974fe58 commit 6abc1f7

File tree

4 files changed

+183
-137
lines changed

4 files changed

+183
-137
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,14 @@ jobs:
4141
permissions:
4242
id-token: write
4343
steps:
44-
- name: Setup python to build package
45-
uses: actions/setup-python@v6
44+
- name: Install uv & Python
45+
uses: astral-sh/setup-uv@v6
4646
with:
47-
python-version: '3.12'
48-
- name: Install build
49-
run: python -m pip install build
47+
python-version: "3.13"
5048
- uses: actions/checkout@v5
5149
with:
5250
fetch-depth: 0
5351
- name: Build package
54-
run: python -m build
52+
run: uv build
5553
- name: Publish to PyPI
5654
uses: pypa/[email protected]

.github/workflows/test.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,16 +172,17 @@ jobs:
172172
- uses: actions/checkout@v5
173173
with:
174174
fetch-tags: true
175-
- uses: actions/setup-python@v6
175+
- name: Install uv & Python
176+
uses: astral-sh/setup-uv@v6
176177
with:
177-
python-version: '3.12'
178-
- name: Install dependencies
179-
run: python3 -m pip install --upgrade build twine
178+
python-version: "3.13"
179+
- name: Ensure uv.lock is up to date
180+
run: env --unset=UV_FROZEN uv lock --check
180181
- name: Build
181182
run: |
182-
python3 -m build .
183-
python3 -m build ext/
183+
uv build .
184+
uv build ext/
184185
- name: Check package metadata
185186
run: |
186-
twine check --strict dist/*
187-
twine check --strict ext/dist/*
187+
uvx twine check --strict dist/*
188+
uvx twine check --strict ext/dist/*

CONTRIBUTING.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ This rule helps us avoid tying in too closely to Django’s undocumented interna
116116

117117
## Releasing `django-stubs`
118118

119-
1. Open a pull request that updates `setup.py`, `ext/setup.py` and `README.md`
119+
1. Open a pull request that updates `pyproject.toml`, `ext/pyproject.toml` and `README.md`
120120
(anyone can open this PR, not just maintainers):
121121

122122
- Version number `major.minor.patch` is formed as follows:
@@ -125,11 +125,12 @@ This rule helps us avoid tying in too closely to Django’s undocumented interna
125125

126126
`patch` is sequentially increasing for each stubs release. Reset to `0` if `major.minor` was updated.
127127

128-
- Update the `version=` value within `setup(...)` call in **both** `setup.py` files. The versions must be in sync.
129-
- Update `django-stubs-ext>=` dependency in root `setup.py` to the same version number.
128+
- Update the `version =` value within `[project]` section in **both** `pyproject.toml` files. The versions must be in sync.
129+
- Update `django-stubs-ext>=` dependency in root `pyproject.toml` to the same version number.
130+
- Update lockfile, run: `uv lock`
130131
- Add a new row at the top of ['Version compatibility' table in README.md](README.md#version-compatibility).
131132
- Use pull request title "Version x.y.z release" by convention.
132-
- Add the correct classifiers to `setup.py` if support is added for a new Python or Django version
133+
- Add the correct classifiers to `classifiers =` if support is added for a new Python or Django version
133134

134135
2. Ensure the CI succeeds. A maintainer must merge this PR. If it's just a version bump, no need
135136
to wait for a second maintainer's approval.

0 commit comments

Comments
 (0)