Python Semantic Release
Automatic semantic versioning for python projects. This is a python implementation of semantic-release for JS by Stephan Bönnemann. If you find this topic interesting you should check out his talk from JSConf Budapest.
The general idea is to be able to detect what the next version of the project should be based on the commits. This tool will use that to automate the whole release, upload to PyPI and post changelogs to GitHub. You can run the tool on a CI service, or just run it locally.
pip install python-semantic-release
Set up Python Semantic Release using the configuration options shown on this page.
The only one which is required is
version_variable, which tells the
tool where to bump the version number:
[semantic_release] version_variable = semantic_release/__init__.py:__version__
There are three different things you can do:
||Create a new release. Will change the version, commit it and tag it.|
||Generate the changelog for the next release.|
Run these commands as
Running from setup.py
Add the following hook to your
setup.py and you will be able to run
python setup.py <command> as you would
try: from semantic_release import setup_hook setup_hook(sys.argv) except ImportError: pass
Running on CI
Getting a fully automated setup with releases from CI can be helpful for some projects. It was the main motivation to create this tool.
See this documentation page for instructions.