Package: verser
verserfrom verser import next_version, Project, next_version_pypi, next_version_localfunctionsnext_version (general function both for pypi and local)first checks PYPI if not then checks local> default parameters :
> pypi = True
> part = 'patch' => increments patch part of your version. Options : major/minor/patch/pre/build
> write = True => if True writes a new version file on your local path 'your_package_name/__version__.py'
> first makes a request to PYPI server to get information about your package
> then increments it depending on your choices
> If it is not a PYPI package or if pypi parameter is false checks local version file to incrementUsage example:from verser import Project,  next_version
from pathlib import Path

project = Project(package_name="evdspy",
                  default_version=default_vers,
                  version_file_path=Path() / "evdspy" / "__version__.py")
    
new_version = next_version(project, write=True, part='patch')typically in your setup.py file you may use this variable like below#file: setup.py
...
from verser import Project,  next_version
from pathlib import Path

project = Project(package_name="evdspy",
                  default_version=default_vers,
                  version_file_path=Path() / "evdspy" / "__version__.py")
    
new_version = next_version(project, write=True, part='patch')

# the setup
setup(
    name=f"{package_name}",
    version=new_version,
    description=f"{description}",
...next_version_pypi (only for pypi packages)new_version = next_version_pypi('rich')
print(new_version)
# results :  12.6.1 

new_version = next_version_pypi('rich' , part = 'minor')
print(new_version)
# results :  12.7.0next_version_localit only checks localversion.py file inside the root of your project creates one if does not existnew_version =  next_version_local( 
    package_name = 'some_cool_project_not_published' , 
    increment_choice = True,  => if selected False it will not increment current version 
    part = "minor"              => it will increment minoÄ±r part of your package version 
    write = True ,              => since write is True it will rewrite current version to the version file 
)
print(new_version)
    # defaults 
#   --------next_version_pypi-------
#   increment_choice = True ,   => if selected False it will not increment current version 
#   part='patch'                 => it will ignore this parameter
#   write = True ,              => since write is True it will rewrite current version to the version fileSome examplesnew_version = next_version_pypi('rich' , part='major')
new_version = next_version_pypi('rich' , part='patch')
new_version = next_version_pypi('rich' , part='major')
new_version = next_version_pypi('rich' , part='pre' , write=True )
new_version = next_version_pypi('rich' , part='build' , write=False )



new_version =  next_version_local( 
        package_name = 'some_cool_package' , 
        increment_choice = True 
        part = "minor"              
        write = True ,             
    )

new_version =  next_version_local( 
        package_name = 'some_cool_package' , 
        increment_choice = False  
        part = "patch"              
        write = True ,             
    )