Semantic version number based on scm tags and branches
Project description
setup_scmversion
Builds a semantic version number based on information available on your scm (tag, branch, and number of commits).
See LICENSE for important licensing information.
Instalation
pip install jfaleiro.setup-scmversion
Or as a dev
dependency in poetry
:
poetry add jfaleiro.setup-scmversion --dev
poetry update
Currently only git
is supported.
Use
A semantic version number is created from standard data available in your scm, i.e. tag, branch name, and number of commits from a tag or master. It supports a simple workflow:
- Versions follow a simplified semantic versioning scheme.
- Non-production releases are produced from release branches named
release/<version>
. - Non-production releases are produced from feature-releases named
feature/<version>
. - Production releases and releases candidates are generated from a
tag
inmaster
after a release branch is merged to master. The version will match the tag.
Simplest Use
Should apply to most projects. Tag the current version before build or deploy using a command line:
$ scmversion version
0.0.1.dev1
V=`scmversion version`
echo
0.0.1.dev1
or the type of version:
$ scmversion version-type
RELEASE_BRANCH
The type of version can be one of RELEASE
, RELEASE_BRANCH
, FEATURE_BRANCH
, or OTHER
.
Pre-commit
For use as a pre-commit
hook add this to your .pre-commit-config.yaml
- repo: https://gitlab.com/jfaleiro.open/setup_scmversion
rev: 0.0.5
hooks:
- id: tag-version
Versioning Schema
- Release branches
release/<version>
withnnn
differences from master will produce aRELEASE_BRANCH
with a version<version>-dev<nnn>
- Feature branches
feature/<version>
withnnn
differences from master will produce aFEATURE_BRANCH
with a version<version>-feature<nnn>
- A well-formed tagged version
<tag>
on master will produce aRELEASE
version<tag>
. - Everything else will produce
0.0.0+master...
for master or0.0.0+other...
for any other branch.
Project details
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 jfaleiro.setup-scmversion-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f0429b837dbbab297ff33a95432b156c2ff71b6255433f3bc4821a73d810529 |
|
MD5 | 7c9ec76651631e1aeca93d528a2d04aa |
|
BLAKE2b-256 | eca918c89c2da87b95990efd1f641e3dc7aafdd127b319341e6a63cbfea3fd7e |
Hashes for jfaleiro.setup_scmversion-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4748cb0d7114f1e6887e2fecd28358396c15bad66bb60232f7ce55b2252f56d3 |
|
MD5 | bf4343428dcbe1889bd996bb4c2ce008 |
|
BLAKE2b-256 | 3d644eef2625455a864acb64cb09182b6f14ba1891367de91daf621c77d260f2 |