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 Lint result

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 will do the followings:

  1. Find a file that defined the package version (__version__ variable)

  2. Create a git tag from the package version information
    • GPG signing to the git tag if --sign option is specified

  3. Push git tags

  4. Upload package files to PyPI by 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.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

releasecmd-0.10.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: releasecmd-0.10.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for releasecmd-0.10.0.tar.gz
Algorithm Hash digest
SHA256 6bb137230a8b6fc3ea0eb572b5ab027142c856a80b838550b59a412890d06300
MD5 af53c80074749c69c78ceff7424a86f3
BLAKE2b-256 7bdf02b945c81303ae869e177bf6132f1bcb34637adfc8eb92da2c3b90d01920

See more details on using hashes here.

File details

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

File metadata

  • Download URL: releasecmd-0.10.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for releasecmd-0.10.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93f62fb0a80e97d83547db60d294df06eb9a80d6f18cb78eeb182e3f5e1b2c10
MD5 756b7f33ddb53a5115dfca4f91c18d6a
BLAKE2b-256 f1b6cec749b2a5e2de33aad3b62faf255efba68fe9e1484011d7cbc81b4b6114

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