From cde30161c8ee9149d7b9fbbc51a50042a2a93bc6 Mon Sep 17 00:00:00 2001 From: Rashid N H M <95639609+rashidnhm@users.noreply.github.com> Date: Mon, 6 May 2024 16:47:15 -0400 Subject: [PATCH] Ringo, please calm down (#716) * Try fix on version update script * Auto update version from '0.36.0-dev47' to '0.36.0-dev48' * trigger ci --------- Co-authored-by: ringo-but-quantum Co-authored-by: Ali Asadi <10773383+maliasadi@users.noreply.github.com> --- .github/workflows/dev_version_script.py | 9 ++++++++- pennylane_lightning/core/_version.py | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dev_version_script.py b/.github/workflows/dev_version_script.py index 033296e33f..907996aa06 100644 --- a/.github/workflows/dev_version_script.py +++ b/.github/workflows/dev_version_script.py @@ -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: diff --git a/pennylane_lightning/core/_version.py b/pennylane_lightning/core/_version.py index 66cb20c0e9..f855d9047c 100644 --- a/pennylane_lightning/core/_version.py +++ b/pennylane_lightning/core/_version.py @@ -16,4 +16,4 @@ Version number (major.minor.patch[-label]) """ -__version__ = "0.36.0-dev47" +__version__ = "0.36.0-dev48"