Skip to main content

releasecmd

PyPI package version Supported Python versions CI status CodeQL

Summary

releasecmd is a release subcommand for setup.py (setuptools.setup). The subcommand creates a git tag and pushes and uploads packages to PyPI.

The subcommand class (releasecmd.ReleaseCommand) is implemented as a subclass of setuptools.Command class. The release subcommand performs the following tasks:

  1. Detect the package version
    1. If specified with the --version option, use that version

    2. Retrieve the package version from an installed package if the --use-installed-version option is specified

    3. Find a file that defines the package version (__version__ variable)

  2. Creates a git tag using the package version information
    • Optionally signs the git tag with GPG if the --sign option is specified

  3. Pushes the git tag

  4. Upload package files to PyPI using twine.

Installation

pip install releasecmd

Usage

setup.py:
import setuptools

from releasecmd import ReleaseCommand

setuptools.setup(
    ...
    cmdclass={"release": ReleaseCommand},
)

Example

$ python3 setup.py release
running release
[get the version from ./releasecmd/__version__.py]
[pull git tags]
Already up to date.
[check existing git tags]
[create a git tag: v0.0.15]
[push git tags]
[upload the package to PyPI]
...

prerequisite: package binaries must be in the dist/ directory.

Specify version manually

You can specify a version manually by --version option:

$ python3 setup.py release --version 0.1.0
[create a git tag: v0.1.0]
[pull git tags]
Already up to date.
[check existing git tags]
[push git tags]
[upload packages to PyPI]

Create a GPG signed tag and upload packages

$ python3 setup.py release --sign
running release
[get the version from ./releasecmd/__version__.py]
[pull git tags]
Already up to date.
[check existing git tags]
[create a git tag with gpg signing: v0.1.0]
[push git tags]
[upload packages to PyPI]
...

Skip create a git tag and upload packages

$ python3 setup.py release --skip-tagging
running release
[get the version from ./releasecmd/__version__.py]
skip git tagging
[upload packages to PyPI]
...

release command options

Options for 'ReleaseCommand' command:
  --skip-tagging           skip a git tag creation
  --skip-uploading         skip uploading packages to PyPI
  --dry-run                don't actually do anything
  --sign                   make a GPG-signed git tag
  --verbose                show verbose output
  --search-dir             specify a root directory path to search a version
                           file. defaults to the current directory.
  --tag-template           specify git tag format. defaults to 'v{version}'
  --use-installed-version  use an installed package version as a release
                           version
  --version                specify release version

Dependencies

  • Python 3.8+

  • Git

Release files for releasecmd 0.10.4

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

Source distribution (sdist)

Source distribution for releasecmd 0.10.4
File Size Uploaded
releasecmd-0.10.4.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for releasecmd 0.10.4
File Interpreter ABI Platform
releasecmd-0.10.4-py3-none-any.whl Python 3 none any Details

Total release size: 19.1 kB

Release files / releasecmd-0.10.4.tar.gz

Download URL releasecmd-0.10.4.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9f5ab60fe4d152983c7f1cf29f6e3588b53b4a4bc42dc218b8ac4fe9cf401b21
BLAKE2b-256 checksum
How to use checksums
bda17d9b457e2ee995ec08cad3a75e39a006c94f03325b33a77416bd0f6652a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / releasecmd-0.10.4-py3-none-any.whl

Download URL releasecmd-0.10.4-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04ff3f4c70ee7ce05c1cb47ac27d74fb3dc45a401b2cc41042a2153a5afd9a79
BLAKE2b-256 checksum
How to use checksums
f6712747ddb5124a9f3237839f9e4d958038e3021295921a8c1a2d77814dc0f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.10.4 This release

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.20

2 release files

0.0.14

2 release files

0.0.13

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

1 release file

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

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