Skip to main content

verser

Project description

Python package Python 3.8 Python 3.9 Python 3.10

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

If you're not sure about the file name format, learn more about wheel file names.

verser-0.0.0.13rc1-py2.py3-none-any.whl (14.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file verser-0.0.0.13rc1-py2.py3-none-any.whl.

File metadata

  • Download URL: verser-0.0.0.13rc1-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for verser-0.0.0.13rc1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 189059cf3820acc2ee01d583c4d4e20d1da0888c31ae4389d83cd096c89db943
MD5 44d329f0cac8f1d2bac47b2d4ff97fad
BLAKE2b-256 de77cf02a3b437276a1288e4273a9bb8c5068bebe095fe9ada83ba8bd0c4fac1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page