Builds a pythonic version number sbased on scm tags and branches
Project description
setup_scmversion
Builds a pythonic version number based on information available on your scm (tag, branch, and number of commits).
See LICENSE for important licensing information.
Instalation
Your setup.py
will need jfaleiro.setup_scmversion
to start - so you either make sure you have it pre-installed using pip:
pip install jfaleiro.setup_scmversion
or add this on the very top of your setup.py
and forget about it moving forward.
try:
import setup_scmversion
except ModuleNotFoundError as e:
from pip._internal import main
assert main('install jfaleiro.setup_scmversion'.split()) == 0
from setup_scmversion import version
You should add it to your setup_requires
parameter in setup.py
as well:
setup(
...
setup_requires=['jfaleiro.setup_scmversion'],
...
)
Using
A pythonic version number is created from standard data available in your scm, i.e. tag, branch name, and number of differences from master:
setup(
...
version=version(),
...
)
For example, release tags release/<version>
with nnn
differences from master will produce version <version>.dev<nnn>
and a tagged version <tag>
on master will produce the version <tag>
. Everything else will produce master.dev<nnn>
for master or no-version.dev<nnn>
for any other branch.
You can also use a command line based shortcut to peek at the current version:
jfaleiro@itacoatiara:~/gitrepos/setup_scmversion (release/0.0.1 *+)$ scmversion
0.0.1.dev1
Enjoy.
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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0e9fdf3a3dda8f9754062fdfdda8349cd2f0e02cd65e57130cf57d07be7163a7 |
|
MD5 | 566abfb9215a1e3ff41486f67795b349 |
|
BLAKE2b-256 | c28da376f7a1c4caa78952855f9dddf8730b0c4c8d17fae0995ce407d72c54a9 |
Hashes for jfaleiro.setup_scmversion-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 817a126dfb614d19032a92c197726a53c788cd80a2c2205e83c33cac13978d7a |
|
MD5 | 45ee24ed4f2042dc04be64f1552fda6d |
|
BLAKE2b-256 | ffe9e705d52173a9315d5ddc4da19060708e6089cfa5d2ad8283ca254376e1bf |