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
v = Version.get_from_git_describe()
print(v.core) # major.minor.patch
print(v.full) # major.minor.patch[-prerelease][+build]
pip install version-helper
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)
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='=',
)
All notable changes to this project will be documented in the CHANGELOG.md.