Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix version string on non-master branch to comply with PEP440 #219

Merged
merged 2 commits into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions spydrnet/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ def update_versionfile():

git_version = git_describe_output.strip()
if git_version.startswith("v"):
# Mimic setuptools_scm behavior
# See https://stackoverflow.com/questions/35522047/pep440-compliant-and-git-describe-info-available-from-deployed-package
dash_idx = git_version.find("-")
git_version = git_version[:dash_idx] + "+g" + git_version[dash_idx + 1 :]

version_file = Path(directory, "VERSION")
with open(version_file, "w") as fh:
fh.write(git_version + "\n")
Expand Down
Loading