version_callback¶
Callback to be used for getting a version number.
Used by Execute some callback function to get current version versioning schema.
Note
This option conflicts with version_file, only one of them can be set.
Type¶
str or Callable[[], str]
Default value¶
None
Possible values¶
NoneDisables this feature
function/lambda (
setup.pyonly)function full name in format
"some.module:function_name"Function should have signature
() -> str. It should return version numbervariable (
setup.pyonly)variable full name in format
"some.module:veriable_name"Variable should contain
strvalue with version number
Note
If your config file is pyproject.toml you should add this to allow setuptools-git-versioning to access your module source code:
[build-system]
...
build-backend = "setuptools.build_meta:__legacy__"
...
Warning
If function return value or variable content is not PEP 440 compatible version, the exception will be raised
Warning
Exception will also be raised if module or function/lambda/variable is missing