Skip to content

Commit

Permalink
parse version_obj to dump_version
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiyuan Chen <[email protected]>
  • Loading branch information
ZhiyuanChen committed May 25, 2023
1 parent 2fa9977 commit 831a8c6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/setuptools_scm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

def dump_version(
root: _t.PathT,
version: Version,
version_str: str,
write_to: _t.PathT,
template: str | None = None,
Expand All @@ -65,6 +66,7 @@ def dump_version(
with open(target, "w") as fp:
fp.write(template.format(
version=version_str, # for backward compatibility with previous versions
version_obj=version,
version_str=version_str,
version_tuple=version_tuple
))
Expand Down Expand Up @@ -167,6 +169,7 @@ def _get_version(config: Configuration) -> str | None:
if config.write_to is not None:
dump_version(
root=config.root,
version=parsed_version,
version_str=version_str,
write_to=config.write_to,
template=config.write_to_template,
Expand Down

0 comments on commit 831a8c6

Please sign in to comment.