Skip to content

Conversation

intgr
Copy link
Collaborator

@intgr intgr commented Sep 29, 2025

Aligns parts of django-stubs with the changes I have been making in djangorestframework-stubs:

Changes:

  • Using uv build instead of PyPI build dependency
  • Added build-and-check check to ensure uv.lock is up to date
  • Updated from Python 3.12 to 3.13

Aligns `django-stubs` with the changes I have been making in `djangorestframework-stubs`.
@intgr
Copy link
Collaborator Author

intgr commented Sep 29, 2025

Related note: djangorestframework-stubs uses build system uv_build instead of hatchling. https://github.com/typeddjango/djangorestframework-stubs/blob/73ce41a8b87f83f08d33c5d4cda5f52b6835ee10/pyproject.toml#L58-L60

I'm not sure if there are any significant differences between the two. I can submit a PR to change it here too, if anybody thinks that's beneficial.

@intgr intgr requested a review from Copilot September 29, 2025 20:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR modernizes the build and release workflows by migrating from traditional Python build tools to uv, a modern Python package manager. The changes align django-stubs with similar updates made to djangorestframework-stubs.

  • Replaced PyPI build dependency with uv build command
  • Added lockfile validation to ensure uv.lock stays up-to-date
  • Updated Python version from 3.12 to 3.13 across workflows

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
CONTRIBUTING.md Updated release documentation to reference pyproject.toml instead of setup.py and added uv lock step
.github/workflows/test.yml Migrated build-and-check job to use uv with lockfile validation
.github/workflows/release.yml Updated release workflow to use uv build instead of Python build module

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@sobolevn sobolevn merged commit 6abc1f7 into typeddjango:master Sep 29, 2025
39 checks passed
@intgr intgr deleted the release-workflow-to-uv branch September 29, 2025 21:27
@UnknownPlatypus
Copy link
Contributor

I'm not sure if there are any significant differences between the two. I can submit a PR to change it here too, if anybody thinks that's beneficial.

Don't have strong opinion on that, I think they both work well for this kind of simple package.
I'll probably don't bother to swap since it's currently working and will probably for the years to come but if you'd prefer to unify and can make it work I'm fine with it too

Copy link
Member

@ngnpope ngnpope left a comment

Choose a reason for hiding this comment

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

I'm not sure if there are any significant differences between the two. I can submit a PR to change it here too, if anybody thinks that's beneficial.

For my 2¢, I'm happy for this to be switched to the uv-build backend. One less explicit dependency (as uv already bundles its own build backend).

Comment on lines +187 to +188
uvx twine check --strict dist/*
uvx twine check --strict ext/dist/*
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants