Semver Git Hook
Install
Works with python 3.6+
First, install the tool using python ecosystem :
pip install --user semver-git-hook
Use
Then set the hook in your current folder git repository :
semver-git-hook --init
That is all. Now on commit a release version type is asked interactively.
On commit some version change will be saved in a .version file. It is automatically added to the current commit.
With this enabled you have your project version set in the .version file that it is possible to dynamically load to your dev environment versionning settings.
For exemple in python the setup.py can look like
# setup.py
with open('.version') as f:
version = f.read()
setup(
#...
version=version,
#...
)
and javascript
//That can be a version.js file that is triggered in .git/hooks/pre-commit
const f = require('fs')
const version = f.readFileSync('.version', 'utf-8')
const package = JSON.parse(f.readFileSync('package.json', 'utf-8'))
package.version = version
f.writeFileSync('package.json', JSON.stringify(package, null, 4))
Options
It is possible to change .version file location by setting a prefix in it's path. The file will be located at SEMVER_HOOK_PATH_PREFIX.version where SEMVER_HOOK_PATH_PREFIX is an environment variable.
Metadata
Release files for semver-git-hook 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| semver-git-hook-1.0.5.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| semver_git_hook-1.0.5-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 8.0 kB
Release files / semver-git-hook-1.0.5.tar.gz
| Download URL | semver-git-hook-1.0.5.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
557d85d8920468da849e44a7b40f14e160620f82d8903df47d08816ec68ac448
|
|
BLAKE2b-256 checksum How to use checksums |
7f8f0ccf8601680c36bd665836cf5912191825ffd4740e7e358c23556f782a99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
|
Release files / semver_git_hook-1.0.5-py2.py3-none-any.whl
| Download URL | semver_git_hook-1.0.5-py2.py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
40ac544918e5e56c6a1fefff6fe76b7c42d59425201b7705c370755096c1d471
|
|
BLAKE2b-256 checksum How to use checksums |
28f673ba67acbfc604d15f749a51d084b7c32eb55eafef18cf4ac5724c591a1d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7
|