Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Make a Release

Make a release of a Python package. This automates the tedious steps you need to go through to make a release--bumping the version number, tagging, etc.

It does not (currently) create distributions or upload them to PyPI.

Usage

make-release --version 1.0 --next-version 2.0

Steps

By default, all the following steps are run:

  • Run the project's test suite (python -m unittest discover by default)
  • Prepare the release by bumping the version number in various files and setting the release date in the change log file
  • Merge the development branch into the target branch (e.g., dev to main)
  • Create an annotated tag pointing at the merge commit (or at the prep commit when merging is disabled); if no tag name is specified, the release version is used as the tag name
  • Resume development by bumping the version to the next anticipated version

Any of the steps can be skipped by passing the corresponding --no-<step> flag.

Tag Name

The tag name can be specified as a simple format string template. The project name and release version will be injected (see below in the Configuration section for an example).

Configuration

Configuration can be done in pyproject.toml or setup.cfg. This is most useful if you want to permanently change one of the default options.

Use the long names of the command line options without the leading dashes. For command line flags, set the value to true or false (1 and 0 also work).

For example, if your project only uses a single branch, you could disable the merge step like so in pyproject.toml.

# pyproject.toml
[tool.make-release.args]
merge = false
tag-name = "{name}-{version}"
test-command = "my-test-runner"

or like so in setup.cfg:

# setup.cfg
[make-release.args]
merge = false
tag-name = {name}-{version}
test-command = my-test-runner

This also shows how to specify a tag name template that's derived from the package name and the release version.

Creating and Uploading Distribution

Once you've created a release with this tool, check out the tag for the release and then run the following commands:

poetry build           # if using poetry
python setup.py sdist  # if using pip/setuptools
twine upload dist/*    # in either case

NOTE: You'll need an account on pypi.org in order to upload distributions with twine.

Limitations

  • Only git repositories are supported
  • The package name detection assumes the root directory (i.e., the git repo name) is the same as the package name
  • For the change log, only markdown files are supported; the change log is expected to use second-level (##) headings for each version's section (see this project's CHANGELOG.md for an example)
  • Doesn't build or upload distributions

Metadata

Release files for com-wyattbaldwin-make-release 1.0a4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for com-wyattbaldwin-make-release 1.0a4
File Size Uploaded
com_wyattbaldwin_make_release-1.0a4.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for com-wyattbaldwin-make-release 1.0a4
File Interpreter ABI Platform
com_wyattbaldwin_make_release-1.0a4-py3-none-any.whl Python 3 none any Details

Total release size: 23.1 kB

Release files / com_wyattbaldwin_make_release-1.0a4.tar.gz

Download URL com_wyattbaldwin_make_release-1.0a4.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ba878b8cf2a48190aa79b6fb8ae832a030059194d4df7f9fb3c9a55c826c414a
BLAKE2b-256 checksum
How to use checksums
cf4614a07a30be4858c74b0a01539d8fe960a98ddd0c42cf4917dc938ed685b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1

Release files / com_wyattbaldwin_make_release-1.0a4-py3-none-any.whl

Download URL com_wyattbaldwin_make_release-1.0a4-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdf05b0759c393bf14c81bd47632acb080d462613c853d4e2288126ffbfaec1a
BLAKE2b-256 checksum
How to use checksums
054e6f07edfa97ddfcdb13c22c5b151d551bb0327295171f1a7965093e7b5f2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.1
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page