Skip to content

Commit

Permalink
Try fix on version update script
Browse files Browse the repository at this point in the history
  • Loading branch information
rashidnhm committed May 6, 2024
1 parent cc57f14 commit 76ca024
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/dev_version_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,14 @@ def update_prerelease_version(repo_root_path: Path, version: Version):
# Only attempt to bump the version if the pull_request is:
# - A prerelease, has `X.Y.Z-prerelease` in _version.py
# - The prerelease startswith `dev`. We do not want to auto bump for non-dev prerelease.
if pr_version.prerelease and pr_version.prerelease.startswith(DEV_PRERELEASE_TAG_PREFIX):
# However,
# If a PR is of a higher version AND the prerelease tag is reset, then do nothing
# This captures the case during release where we might bump the release version
# within a PR and reset tag back to dev0
if pr_version > master_version and pr_version.prerelease and pr_version.prerelease == DEV_PRERELEASE_TAG_START:
print("This Pull Request is upgrading the package version to next release ... skipping bumping!")
print("If this is happening in error, please report it to the PennyLane team!")
elif pr_version.prerelease and pr_version.prerelease.startswith(DEV_PRERELEASE_TAG_PREFIX):
# If master branch does not have a prerelease (for any reason) OR does not have an ending number
# Then default to the starting tag
if not master_version.prerelease or master_version.prerelease == DEV_PRERELEASE_TAG_PREFIX:
Expand Down

0 comments on commit 76ca024

Please sign in to comment.