Package: seversion
seVersionCLI to enhance versioning for Python projects.Basic UsageInstall seVersion to local environment withpip install seVersion, then runseVersion <projectname> --createto create project version file named_version.pyin your project. If folder does not exist you can add--cdneand it will create folderand_version.pyfile for projectNote:setting<projectname>toappfor examples$seVersionapp--create--cdne--------------------------------------------------------------------seVersion | INFO     |          Creating: FilePath('./app')seVersion | INFO     | Creating codebase: 2023.10.0seVersion | INFO     |          Updating: ./app/_version.py# file: _version.py"""Provides `app` version information."""# This file is auto-generated! Do not edit!# Use `seVersion app` to change this file.fromseVersionimportVersion__version__=Version("app",2023,10,0,0)__setuptools__=__version__.public()__all__=["__version__"]If__init__.pydoesn't exist it will be created, otherwise add the following to your root package's__init__.py.This will allow users of your project can find your version:# file: __init__.pyfrom._versionimport__version__,__setuptools__Incremental VersionsseVersion.Versionis a class that represents a version of a given project.
It is made up of the following elements (which are given during instantiation):package(required), the name of the package thisVersionrepresents.major,minor,micro(all required), the X.Y.Z of your project'sVersion.release_candidate(optional), set to 1 or higher to mark thisVersionbeing of a release candidate/pre-release.post(optional), set to 1 or higher to mark thisVersionas a post release.dev(optional), set to 1 or higher to mark thisVersionas a development release.You can extract a PEP-440 compatible version string by using the.public()method, which returns astrcontaining the full version. This is the version you should provide to users, or publicly use.An example output would be"2023.1.0","2023.1.2dev1", or"2023.1.2rc1".Callingrepr()with aVersionwill give a Python-source-code representation of it, and callingstr()with aVersionwill provide a string similar to'[<projectname>, version 23.1.0]'.fromappimport__version__,__setuptools__print(f'{"__version__":>25}:{__version__}')print(f'{"__setuptools__":>25}:{__setuptools__}')print(f'{".public()":>25}:{__version__.public()}')print(f'{".public_build()":>25}:{__version__.public_build()}')print(f'{".repr()":>25}:{repr(__version__)}')print(f'{".str()":>25}:{str(__version__)}')__version__: [app, version 2023.12.0, build 0 ]__setuptools__: 2023.12.0.public(): 2023.12.0.public_build(): 2023.12.0 build[0].repr(): Version("app", 2023, 12, 0, 0).str(): [app, version 2023.12.0, build 0 ]Updating VersionseVersionincludes a cli tool calledseVersionto automate updating your project's versioning by
automatically updating the_version.pyfile.seVersion <projectname> <commands>will perform updates on_version.pyfile:Return the current version$seVersionapp--------------------------------------------------------------------seVersion | INFO     |      Project Path: ./app/_version.pyseVersion | INFO     |   Current Release: 2023.10.0seVersion | INFO     |     Build Release: 2023.10.0 build[0]--createWill set the project version to<year>.<month>.0$seVersionapp--create--------------------------------------------------------------------seVersion | INFO     | Creating codebase: 2023.10.0seVersion | INFO     |          Updating: ./app/_version.py--newversion=2023.10.1.rc1Sets the project version to a fully-specified version (like 0.9.0 or 2023.2.1.rc1 or 2023.2.1.dev1 or 2023.2.1.post1).$seVersionapp--newversion=2023.10.1.rc1--------------------------------------------------------------------seVersion | INFO     | Updating codebase: 2023.10.1.rc1seVersion | INFO     |          Updating: ./app/_version.py--rcSets the current version<major>.<minor>.<micro>to<major>.<minor>.<micro>.rc1if the current version is not a release candidate, or bump the release candidate number by 1 if it is.$seVersionapp--rc--------------------------------------------------------------------seVersion | INFO     |  Current codebase: 2023.10.1.rc1seVersion | INFO     | Updating codebase: 2023.10.1.rc2seVersion | INFO     |          Updating: ./app/_version.py--devSets the project development release number to 0 if it is not a development release, or bump the development release number by 1 if it is.$seVersionapp--dev--------------------------------------------------------------------seVersion | INFO     |  Current codebase: 2023.10.1.rc2seVersion | INFO     | Updating codebase: 2023.10.1.dev0seVersion | INFO     |          Updating: ./app/_version.py--postSets the project post release number to 0 if it is not a post release, or bump the post release number by 1 if it is. This will also reset the release candidate and development release numbers.$seVersionapp--post--------------------------------------------------------------------seVersion | INFO     |  Current codebase: 2023.10.1.dev0seVersion | INFO     | Updating codebase: 2023.10.1.post0seVersion | INFO     |          Updating: ./app/_version.py--patchIncrements the patch number of the release. This will also reset the release candidate number, pass --rc at the same time to increment the patch number and make it a release candidate.$seVersionapp--patch--------------------------------------------------------------------seVersion | INFO     |  Current codebase: 2023.10.1.post0seVersion | INFO     | Updating codebase: 2023.10.2seVersion | INFO     |          Updating: ./app/_version.py--releaseThis will reset the release candidate, development and post number making it a"full release".$seVersionapp--release--------------------------------------------------------------------seVersion | INFO     |  Current codebase: 2023.10.2.post0seVersion | INFO     |   Current Release: 2023.10.2seVersion | INFO     |          Updating: ./app/_version.py--minorIncrements the minor number of the release, and reset the patch/micro number to 0.$seVersionapp--minor--------------------------------------------------------------------seVersion | INFO     |  Current codebase: 2023.10.2seVersion | INFO     | Updating codebase: 2023.11.0seVersion | INFO     |          Updating: ./app/_version.py--majorIncrement the major number of the release, reset minor number to  and reset the patch/micro number to 0.$seVersionapp--major--------------------------------------------------------------------seVersion | INFO     |  Current codebase: 2023.11.0seVersion | INFO     | Updating codebase: 2024.10.0seVersion | INFO     |          Updating: ./app/_version.py--buildIncrements the build number, and does not get reset unless--createis used.$seVersionapp--build--------------------------------------------------------------------seVersion | INFO     |  Current codebase: 2024.10.0 build[0]seVersion | INFO     | Updating codebase: 2024.10.0 build[1]seVersion | INFO     |          Updating: ./app/_version.py--cleanRemoves _version.py from codebase.$seVersionapp--clean--------------------------------------------------------------------seVersion | INFO     | Cleaning codebase: Removing FilePath('./app/_version.py')Error/Warning CodesSE-01100Could not find project/packageseVersion | WARNING  |       SE-01100: Can't find `<project/package>` under `./src` or `./`seVersion | WARNING  |                    Check the package name is right (note that we expect your package name to be lower cased), or pass it using '--path'seVersion | WARNING  |                    or add `--cdne` to automatically initialize the project to create folder and filesSE-01300Do not add any extra command to--createseVersion | ERROR    |       SE-01300: --create error, only --cdne is allowed to be used with this command to create package\project folder if does not existSE-01301Do not add any extra command to--newversionseVersion | ERROR    |       SE-01301: --newversion=?.?.? error, no other commands need to be usedSE-01302Do not add any extra command to--devseVersion | ERROR    |       SE-01302: --dev error, no other commands need to be usedSE-01303Do not add any extra command to--rcseVersion | ERROR    |       SE-01303: --rc error, no other commands need to be usedSE-01304Do not add any extra command to--patchseVersion | ERROR    |       SE-01304: --patch error, no other commands need to be usedSE-01305Do not add any extra command to--majorseVersion | ERROR    |       SE-01305: --major error, no other commands need to be usedSE-01306Do not add any extra command to--minorseVersion | ERROR    |       SE-01306: --minor error, no other commands need to be usedSE-01307Do not add any extra command to--buildseVersion | ERROR    |       SE-01307: --build error, no other commands need to be usedSE-01308Do not add any extra command to--postseVersion | ERROR    |       SE-01308: --post error, no other commands need to be usedSE-01309Do not add any extra command to--releaseseVersion | ERROR    |       SE-01309: --release error, no other commands need to be usedSE-01310Do not add any extra command to--cleanseVersion | ERROR    |       SE-01310: --clean error, no other commands need to be used