Open casperdcl opened 3 months ago
pretend_version currently has no scm metadata avaliable, its a string and not turned back into a scm_version - there should be warnings
ok, FYI I'm using this work-around:
[tool.setuptools_scm]
version_file_template = """
version = '{version}'
commit_hash = '{scm_version.node}'
distance = {scm_version.distance}
# work-around for https://github.com/pypa/setuptools_scm/issues/1059
if (commit_hash, distance) == ('None', 0):
import re
if (_v := re.search(r'\\.dev(\\d+)\\+(\\w+)', version)):
distance, commit_hash = int(_v.group(1)), _v.group(2)
"""
I think I need to introduce a mechanism to provide scm version metadata
Perhaps adding e.g. (?P<node>)
and (?P<distance>)
to DEFAULT_TAG_REGEX
?
adding those to the tag regex will do no good
instead good default overrides as well as a utility helper to create the overrides from forge metadata will be required
you mean you'd prefer SETUPTOOLS_SCM_PRETEND_{NODE,DISTANCE}
?
The idea would be to inject a toml mapping with the metadata
pyproject.toml
config:build:
output:
It's odd that
version
is correctly parsed intoversion_tuple
but notscm_version.node
norscm_version.distance
.