Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,14 @@ jobs:
permissions:
id-token: write
steps:
- name: Setup python to build package
uses: actions/setup-python@v6
- name: Install uv & Python
uses: astral-sh/setup-uv@v6
with:
python-version: '3.12'
- name: Install build
run: python -m pip install build
python-version: "3.13"
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Build package
run: python -m build
run: uv build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.13.0
17 changes: 9 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,17 @@ jobs:
- uses: actions/checkout@v5
with:
fetch-tags: true
- uses: actions/setup-python@v6
- name: Install uv & Python
uses: astral-sh/setup-uv@v6
with:
python-version: '3.12'
- name: Install dependencies
run: python3 -m pip install --upgrade build twine
python-version: "3.13"
- name: Ensure uv.lock is up to date
run: env --unset=UV_FROZEN uv lock --check
- name: Build
run: |
python3 -m build .
python3 -m build ext/
uv build .
uv build ext/
- name: Check package metadata
run: |
twine check --strict dist/*
twine check --strict ext/dist/*
uvx twine check --strict dist/*
uvx twine check --strict ext/dist/*
Comment on lines +187 to +188
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of twine in favour of uv publish?

Copy link
Collaborator Author

@intgr intgr Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Publishing (release.yml) doesn't use twine (at least not directly), it uses pypa/gh-action-pypi-publish@v1.13.0.

This is just doing some checks on every PR build. According to twine docs: "Checks whether your distribution’s long description will render correctly on PyPI"

Copy link
Member

@ngnpope ngnpope Sep 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦🏻 Of course, scanned across that too quickly!

However, having now looked at this comment and checked the source myself, I think we can just remove this step entirely - it only checks that rST can render properly and we're using markdown - so it's effectively a noop.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do in a follow-up

9 changes: 5 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ This rule helps us avoid tying in too closely to Django’s undocumented interna

## Releasing `django-stubs`

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

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

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

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

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