Skip to main content

releasecmd is a release subcommand for setup.py (setuptools.setup). the subcommand create a git tag and push, and upload packages to PyPI.

Project description

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. Locates 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         do no harm
  --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}'.
  --version         specify version manually

Dependencies

  • Python 3.8+

  • Git

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

releasecmd-0.10.3.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

releasecmd-0.10.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file releasecmd-0.10.3.tar.gz.

File metadata

  • Download URL: releasecmd-0.10.3.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for releasecmd-0.10.3.tar.gz
Algorithm Hash digest
SHA256 725fb130b575d121e07b837fcb2439e961b49c48e85d34a30e010e961eb6cf57
MD5 4221811fb77a0eb9cef4f40642b9daf5
BLAKE2b-256 6710690db19afabc4866de01351104120a9836e46419aa6da57fa7e31cc65ec3

See more details on using hashes here.

File details

Details for the file releasecmd-0.10.3-py3-none-any.whl.

File metadata

  • Download URL: releasecmd-0.10.3-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for releasecmd-0.10.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f73c908c78fcae2c58b60b7cd62b36b9cb72b0287742503c4256a8e3bd38cbdb
MD5 ab3f3f8532a52da280d9af541ecd45a2
BLAKE2b-256 3309fcb5d197bca0b93afcaf6c906e9a19d9ea464fcfb48901074011496ea107

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page