-
Notifications
You must be signed in to change notification settings - Fork 3
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
Relax semantic versioning pattern #105
Conversation
Co-authored-by: Jim Balhoff <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change the patterns for dated version iris?
Let's try to get for any change we do at least one other obo tech wg person to review.
I guess you are trying to run this now, but I don't think it should be necessary to drop the strict obo version iri refer check (just semver)
I saw Jim reviewed it 😷 sorry. But the question remains.. |
Ah sorry, I was only focused on the numbered version part. I did not check the dated version pattern! |
There's already a date pattern in the next line in the file... It wasn't checking for the purl anymore, that's why I changed it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you constrained the semantic versioning pattern too much here, see comment
PATTERN = re.compile(pat) | ||
#: Official regex for semantic versions from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string | ||
SEMVER_PATTERN = re.compile(r"^(0|[1-9]\d*)\.(0|[1-9]\d*)(\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$") | ||
# Simplify semantic versions to accept only numbers with or without point, .eg 1.1 or 11 | ||
SEMVER_PATTERN = re.compile(r"^(0|[1-9]\d*)(\.)?(0|[1-9]\d*)?((\.)?(0|[1-9]\d*))?$") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are missing quite a bit here: https://semver.org/
Semantic Versioning is a standard which allows versions like these:
- 1.0.0-alpha
- 1.0.0-alpha+001
- 1.0.0+20130313144700
- 1.0.0-beta+exp.sha.5114f85
I would suggest we use the official semver regex: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
Fixes #104