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 create a git tag and push, and upload 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 .asc (ASCII-armored signature) files of the package binary files if --sign option is specified
  3. Create a git tag from the package version information
    • GPG signing to the git tag if --sign option is specified

  4. Push git tags

  5. Upload package files to PyPI by using twine
    • uploading for both the package binaries and .asc files

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 bein in the dist/ directory.

Specify version manually

You can specify a vesion 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]
[create a .asc file for releasecmd-0.1.0.tar.gz]
[create a .asc file for releasecmd-0.1.0-py2.py3-none-any.whl]
[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 tag
    --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.6+

  • 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.8.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

releasecmd-0.8.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: releasecmd-0.8.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.11

File hashes

Hashes for releasecmd-0.8.0.tar.gz
Algorithm Hash digest
SHA256 e9561e0e4c03f69fa7a14cf5f333c0590f629e55e88f1135f2bd663810d534bf
MD5 ff041eeb6537152c4a4656daac554d86
BLAKE2b-256 482fcbb5b06a54cf02600732b70959eaccb4550873d296550fd4d5f07817ce24

See more details on using hashes here.

File details

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

File metadata

  • Download URL: releasecmd-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.11

File hashes

Hashes for releasecmd-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad94a45e187710781a32aa447ebf3b79df6795f8e7d2d90277f330b7ab043e41
MD5 f5c50155d02687045e07e883d9466510
BLAKE2b-256 6103d0ff1880991a969fb2b9877fdb7ba3e5e8a9e32d2f168532a9e18cd0ea47

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