Django Heralder uses UV to build and publish the package.
This library uses Semantic Versioning (semver), meaning versions follow the MAJOR.MINOR.PATCH format.
1.2.3
^ ^ ^
| | |
| | | ------- Patch
| | --------- Minor
Given a version number MAJOR.MINOR.PATCH, increment the:
| Version Type | Example Version | Compatibility | Description |
|---|---|---|---|
| PATCH | 1.2.4 |
Backward-compatible | Increment for bug fixes and minor, backward-compatible improvements. This includes documentation updates. |
| MINOR | 1.3.0 |
Backward-compatible | Increment for new features or improvements in a backward-compatible manner. |
| MAJOR | 2.0.0 |
Breaking changes (incompatible) | Increment for breaking changes (incompatible) that require engineers to modify their applications. This signals a significant release. |
When incrementing the:
- MAJOR: Reset the both MINOR to
0and PATCH to0- Ex:
1.8.9becomes2.0.0
- Ex:
- MINOR: Reset the PATCH to
0- Ex:
1.8.9becomes1.9.0
- Ex:
-
Update the
CHANGELOG.mdfile. Move any[Unreleased]items into a version using an appropriate SemVer version (see above). -
Bump the version number in the
pyproject.tomlusing theuv versioncommand below by providing a positional arugment. This is update thepyproject.tomlfile.uv version 0.5.1 >> Resolved 31 packages in 346ms >> Built django-heralder @ file:///Users/django/Projects/django-heralder >> Prepared 1 package in 725ms >> Uninstalled 1 package in 1ms >> Installed 1 package in 3ms >> - django-heralder==0.5.0 (from file:///Users/django/Projects/django-heralder) >> + django-heralder==0.5.1 (from file:///Users/django/Projects/django-heralder) >> django-heralder 0.5.0 => 0.5.1
- Read more about the
uv versioncommand.
- Read more about the
-
Commit the file changes to
mainand push to GitHub. -
Create a new release and tag on GitHub:
- Go to Draft a new release
- Choose tag. If you have not created a tag yet, you can create one "on publish". Use the format of
vX.X.X. - Set the release title to the version. Ex:
vX.X.X - In the body for the release, copy the bullets of items from the
CHANGELOG.md.
By creating a new git tag using the vX.X.X pattern, the GitHub Action in .github/workflows/publish-pypi.yml will automatically build and publish the new version of the package.
If you want to test publishing to Test PyPI, create a git tag using the test-vX.X.X pattern which will run the GitHub Action in .github/workflows/publish-testpypi.yml.
After preparing the release in steps 1-3 from above, continue to manually build and publish the package.
-
Build the package:
rm -rf dist/ uv build --no-sources
- Use
--no-sourceswhen building to publish per recommendatation from UV
- Use
-
Publish the package to
pypi(production), ortestpypi(test) package repository:uv publish --index [pypi|testpypi]Follow the prompts for a API username
__token__and password (API token). You can configure an API token in your PyPI account or Test PyPI account.