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 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:
Find a file that defined the package version (__version__ variable)
- 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}, )
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]
[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.7+
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
File details
Details for the file releasecmd-0.8.1.tar.gz
.
File metadata
- Download URL: releasecmd-0.8.1.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2321c4ce037ef2c7903af3a2ca6081a9625bb6b88e2e2022d3d6f378a536365 |
|
MD5 | 9a792a44a23a70e0e0f380bb71f3fae5 |
|
BLAKE2b-256 | d8e2ad57cfecf9498dd057cfe1d4396f9f11d6cc6c9650a592b31fccf13231c1 |
File details
Details for the file releasecmd-0.8.1-py3-none-any.whl
.
File metadata
- Download URL: releasecmd-0.8.1-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.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5788f5dd512f843ca67ebf90c1dd3cffafda1aa3028381e524ba00d2c0e340d5 |
|
MD5 | 17a912b7a7b69dc6294ec86625c2919f |
|
BLAKE2b-256 | 868d66ac3098545902c7181a18ccb4369b970591a793e210f16cf215c966867d |