uranusjr commented on code in PR #30680:
URL: https://github.com/apache/airflow/pull/30680#discussion_r1168575156
##########
dev/breeze/src/airflow_breeze/commands/release_candidate_command.py:
##########
@@ -301,18 +303,20 @@ def remove_old_releases(version, repo_root):
)
@option_answer
def publish_release_candidate(version, previous_version, github_token):
- if "rc" not in version:
- exit("Version must contain 'rc'")
- if "rc" in previous_version:
- exit("Previous version must not contain 'rc'")
+ from packaging.version import Version
+
+ if not Version(version).is_prerelease:
+ exit("--version value must be a pre-release")
+ if Version(previous_version).is_prerelease:
+ exit("--previous-version value must be a release not a pre-release")
if not github_token:
github_token = os.environ.get("GITHUB_TOKEN")
if not github_token:
console_print("GITHUB_TOKEN is not set! Issue generation will
fail.")
confirm_action("Do you want to continue?", abort=True)
- version_suffix = version[-3:]
+ version_suffix = version[5:]
Review Comment:
Wouldn’t this break when we reach `2.10` or `10.0`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]