You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am migrating from setuptools to pdm-backend. I want to use a dynamic version extracted from a VERSION file, which only contains the version without any Python syntax. For example:
"""Read version from setuptools compatible VERSION file."""defget_version():
try:
withopen("VERSION") asf:
returnf.read().strip()
exceptFileNotFoundError:
return"0.0.0"
I would like to have a fallback_version in the .toml file for two reasons:
To handle exceptions from the script, allowing me to avoid the except FileNotFoundError: return "0.0.0" block.
To handle an invalid version, for example, if the VERSION file contains a branch+commit string.
The text was updated successfully, but these errors were encountered:
I am migrating from
setuptools
topdm-backend
. I want to use a dynamic version extracted from aVERSION
file, which only contains the version without any Python syntax. For example:So, I choose this setting for dynamic versioning:
And my
get_version.py
is:I would like to have a
fallback_version
in the.toml
file for two reasons:except FileNotFoundError: return "0.0.0"
block.VERSION
file contains a branch+commit string.The text was updated successfully, but these errors were encountered: