Skip to main content

Automatic semantic versioning for python projects

Project description

# python-semantic-release

Automatic semantic versioning for python projects. This is an python implementation of the
[semantic-release][] for js by Stephan Bönnemann. If you find this topic interesting you should
check out his [talk from JSConf Budapest][semantic-release-talk].

[![Build status][build-badge]][last-build] [![Coverage status][coverage-badge]][last-build] ![PyPI version][pypi-badge]

## Install
```
pip install python-semantic-release
```

## Usage
The general idea is to have some sort of tag in commit messages that indicates certain types of changes.
If a commit message lack a tag it is ignored. Running release can be run locally or from a CI service.

```
Usage: semantic-release [OPTIONS] COMMAND

Options:
--major Force major version.
--minor Force minor version.
--patch Force patch version.
--noop No-operations mode, finds the new version number without changing it.
--post If used with the changelog command, the changelog will be posted to the release api.
--help Show this message and exit.
```

### Commands

* `version` - Create a new release. Will change the version, commit it and tag it.
* `publish` - Runs version before pushing to git and uploading to pypi.
* `changelog` - Generates the changelog for the next release.

### Running commands from setup.py
Add the following to your setup.py and you will be able to run `python setup.py <command>`
as you would `semantic-release <command>`.

```python
try:
from semantic_release import setup_hook
setup_hook(sys.argv)
except ImportError:
pass
```

### Configuration
Configuration belong in `semantic_release` section of the setup.cfg file in your project.
Details about configuration options can be found in [the configuration documentation][config-docs].

[last-build]: https://ci.frigg.io/relekang/python-semantic-release/last/
[build-badge]: https://ci.frigg.io/relekang/python-semantic-release.svg
[coverage-badge]: https://ci.frigg.io/relekang/python-semantic-release/coverage.svg
[pypi-badge]: https://badge.fury.io/py/python-semantic-release.svg
[semantic-release-badge]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[gitter-badge]: https://badges.gitter.im/Join%20Chat.svg
[gitter-link]: https://gitter.im/relekang/python-semantic-release?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge
[semantic-release]: https://github.com/semantic-release/semantic-release
[semantic-release-talk]: https://www.youtube.com/watch?v=tc2UgG5L7WM
[config-docs]: http://python-semantic-release.readthedocs.org/en/latest/configuration.html

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

python-semantic-release-3.3.0.tar.gz (15.3 kB view hashes)

Uploaded Source

Built Distributions

python_semantic_release-3.3.0-py3.5.egg (52.1 kB view hashes)

Uploaded Source

python_semantic_release-3.3.0-py2.py3-none-any.whl (22.2 kB view hashes)

Uploaded Python 2 Python 3

python_semantic_release-3.3.0-py2.7.egg (50.6 kB view hashes)

Uploaded Source

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