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.2.1.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_semantic_release-3.2.1-py3.5.egg (52.1 kB view details)

Uploaded Egg

File details

Details for the file python-semantic-release-3.2.1.tar.gz.

File metadata

File hashes

Hashes for python-semantic-release-3.2.1.tar.gz
Algorithm Hash digest
SHA256 4b0c028665e7b97b41622df4e3871bf8471e8e402db86b4fe88bf1c90765d6d3
MD5 87e3624b434b391f1e23cbb008083d5c
BLAKE2b-256 24808f03d755fb7fc71b3fa656960a9f880da6197c28406e1a6e230bdde06f8f

See more details on using hashes here.

File details

Details for the file python_semantic_release-3.2.1-py3.5.egg.

File metadata

File hashes

Hashes for python_semantic_release-3.2.1-py3.5.egg
Algorithm Hash digest
SHA256 92638e611ad4ad11b44b2d2a8e41ff02c5365835b8e9096a4f3f7a2c88be322c
MD5 c66f868c733cf7ead7548b7a1c80675b
BLAKE2b-256 104c31e38f407da69d7439fecd8e9135ff6ca17f2cdd5112e180f82fe7d92f31

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page