Package: scmver
scmver is a package version manager based on SCM tags.It can be used to pass the version to thesetupfunction in asetup.py,
or to generate a file which contains the version.Installation$pipinstallscmverRequirementsPython 3.8+setuptoolsUsagepyproject.toml[build-system]requires=["setuptools >= 42.0","scmver[toml] >= 1.5",]build-backend="setuptools.build_meta"[tool.scmver]spec="micro"write-to="scmver/__version__.py"fallback={attr="scmver:__version__"}write-toAn alias forwrite_to, but it takes precedence.fallbackattrAstringwhich is described infallbackinConfiguration.path(optional)A path to import the module.SeeConfigurationfor key/value pairs.setuptoolsfromsetuptoolsimportsetupsetup(setup_requires=['scmver'],scmver=True)scmveris either following values:TrueIt is same as an emptydict.callable objectIt should return adict.dictSeeConfigurationfor details.distutilsfromdistutils.coreimportsetupimportscmversetup(version=scmver.get_version())SeeConfigurationfor thescmver.get_versionarguments.ConfigurationrootA path of the working directory.Default:'.'specA version specifier to construct the public version identifiers. It will be
incremented by the number of commits from the latest tag.majorIt will increment the major version.minorIt will increment the minor version.microorpatchIt will increment the micro (patch) version.postIt will increment the post-release segment.major.devIt will increment the development release segment after incrementing the
major version by 1.minor.devIt will increment the development release segment after incrementing the
minor version by 1.micro.devorpatch.devIt will increment the development release segment after incrementing the
micro (patch) version by 1.Default:'post'localAstringorcallable objectto construct the local version
identifiers.stringA format string.Available keywords:{distance}{revision}{branch}{utc}- Return value ofdatetime.datetime.now(datetime.timezone.utc){local}- Return value ofdatetime.datetime.now()callable objectIt will be called withscmver.core.SCMInfo.Default:'{local:%Y-%m-%d}'versionA regular expression object to extract the version from SCM tags. It should
contain the version group.write_toA path to a file which will be generated usingtemplate.templateA format string which is used bywrite_to.Available keywords:{version}{revision}{branch}fallbackIt will be used when there is outside of a working copy.stringIt is in the'package.module:some.attribute'format
(ex:'scmver:__version__').listIt consists of astringwhich is described above, and a path to import
the module.callable objectIt should return the version.bazaar.tagA regular expression pattern to filter tags.darcs.tagA regular expression pattern to filter tags.fossil.tagA regular expression pattern to filter tags.git.tagIt will be passed togit describeas--match.mercurial.tagA regular expression pattern to filter tags.subversion.tagA regular expression pattern to filter tags.subversion.trunkA relative repository path of the trunk directory.Default:'trunk'subversion.branchesA relative repository path of the directory where branches are located.Default:'branches'subversion.tagsA relative repository path of the directory where tags are located.Default:'tags'Licensescmver is distributed under the terms of the MIT License.