Helpers for a better version management in python projects
Project description
Version helper
version-helper
is a package for a better version management in python projects.
This package is still under development. Code may change frequently.
from version_helper import Version
# Parse output from `git describe --tag` and
# return a semantic versioning compatible `Version` object
v = Version.get_from_git_describe()
# Output core version string including major, minor and patch
print(v.core)
# Output full Semantic Version string including core, prerelease and build metadata
print(v.full)
Table of contents
Installing version-helper
pip install version-helper
Code example see at the top of this page.
Usage
Reading version from a file
import pathlib
from version_helper import Version
version = Version.read_from_file(
file=pathlib.Path('/path/to/my/version_file.txt'),
variable_name='APP_VERSION',
separator='=',
)
print(version)
Writing version to a file
import pathlib
from version_helper import Version
version = Version(1, 2, 3)
version.write_to_file(
file=pathlib.Path('/path/to/my/version_file.txt'),
variable_name='APP_VERSION',
separator='=',
)
Changelog
All notable changes to this project will be documented in the CHANGELOG.md.
References
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
version-helper-0.2.0.tar.gz
(6.9 kB
view hashes)
Built Distribution
Close
Hashes for version_helper-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a2514713b3b37e6be945732e99a48986567d00dbd4f5592eaf42761f8b5d0dd |
|
MD5 | c1a9ed0a74373f818162d4247a9fb730 |
|
BLAKE2b-256 | a75fdcbef961d8c7dba38432c2316c109735d66fdcf6945875b8e4efdf151bb7 |