Generates next version number for your pyton package. Creates version file and reads from the same path. It also provides useful functions to show your package's version at run time.
Reason this release was yanked:
main file had some mistakes. this version does not load functions properly
Project description
verser
from verser import Project, get_next_version, get_current_version
creates version.py file on your package's root
#__version__.py
#3.1.2.0
next_version = get_next_version(
project=Project("my_cool_project"),
increment_=True,
pre_release=False,
verbose=True
)
# pre_release : False, and increment_ True returns
# 3.1.2.0
# pre_release : True, and increment_ True returns
# 3.1.2.1rc1
# pre_release : True, and increment_ True returns
# 3.1.2.1rc2
# pre_release : False, and increment_ True returns
# 3.1.2.1
next version number for your project
project = Project(package_name="my_cool_package", default_version="0.0.0.0")
next_version = get_next_version(
project=project,
increment_=True,
pre_release=False,
verbose=True
)
print("Getting next version", next_version)
get_next_version (function)
gets current version of the project and increments depending on arguments given by developer...
@params
project : Project => see Project class which takes path to version file
------------
increment_ : bool => it may increment or return same version
------------
if True => depending on pre_release parameter creates new version number
if False => ignores pre_release parameter and just returns current version
pre_release : bool => creates next version by incrementin and adding "rc" text to the version
------------
(lets suppose current version is 0.0.1.2)
if True => creates a version like 0.0.1.3rc1
if False => creates a version like 0.0.1.3
verbose : bool
------------
verbose or silent while doing process
write_version_file : pathlib.Path or str
------------
if True : writes new version to given path
if False : does not write any file
now_testing: bool => default : False
------------
for testing purposes it plays with fake versions
this will be set True while testing development
get_current_version (function)
get_current_version
Read-only function
tries to find out current version of the file and returns.
@params
project : Project => see Project class which takes path to version file
verbose : bool
verbose or silent while doing process
write_version_file : pathlib.Path or str
if True : writes new version to given path
if False : does not write any file
test :
for testing purposes it plays with fake versions
Project (Class)
"""
Project (Class)
@attrs
package_name: str => package name
------------
default_version: str =>
------------
if there is not a version file yet this will be used to start a version number
default is : 0.0.0.0
(when incremented with function below it will be 0.0.0.1 or 0.0.0.1rc1 )
version_file_path: Union[str, Path] =>
------------
Version file address : this will be used to read current version
now_testing: bool => default : False
------------
this will be set True while testing development
"""
example usage
from verser import *
version = get_next_version(verbose=True,
project=Project(package_name="verser",
version_file_path=Path("__version__.py")
)
)
print(version)
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for verser-0.0.0.16-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9c5a740aa3c75f83624e43a12df1f01e81ae3a8d3b2d619df4d7a22e9cdf8d5 |
|
MD5 | 7b21e3691a99cd16dc1230286eb183ae |
|
BLAKE2b-256 | 663400986fe41e943b5ede112954b1561bb221becb65f12b5ea9003c3fdc4d8b |