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
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:
Find a file that defined the package version (e.g. <package>/__init__.py)
- Create .asc (ASCII-armored signature) files of the package binary files if --sign option is specified
- Create a git tag from the package version information
GPG signing to the git tag if --sign option is specified
Push git tags
- 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}, )
release command options
Options for 'ReleaseCommand' command: --skip-tagging skip a git tag creation --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
Example
$ python3 setup.py release
running release
[get the version from ./releasecmd/__version__.py]
[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]
[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]
[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]
[push git tags]
[upload packages to PyPI]
...
Dependencies
Python 3.6+
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for releasecmd-0.6.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 740527f318095329acd4ac96ca48d9246fb303b06188d287744b7d68c67bb8a4 |
|
MD5 | 007c2d4c257d092a69b4379b4c849a68 |
|
BLAKE2b-256 | 3680905b9429a6f1fd618a7e1defc543ebc273f0048b4d96022167dfd2d74415 |