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

Relax semantic versioning pattern #105

Merged
merged 3 commits into from
Dec 19, 2023
Merged

Relax semantic versioning pattern #105

merged 3 commits into from
Dec 19, 2023

Conversation

anitacaron
Copy link
Collaborator

@anitacaron anitacaron commented Dec 19, 2023

Fixes #104

  • Simplify semantic versions to accept only numbers with or without point, .eg 1.1 or 11

@anitacaron anitacaron self-assigned this Dec 19, 2023
@anitacaron anitacaron marked this pull request as draft December 19, 2023 09:43
@anitacaron anitacaron marked this pull request as ready for review December 19, 2023 17:06
util/dashboard/fp_004.py Outdated Show resolved Hide resolved
@anitacaron anitacaron requested a review from balhoff December 19, 2023 19:03
@anitacaron anitacaron merged commit 559c064 into master Dec 19, 2023
Copy link
Contributor

@matentzn matentzn left a 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)

@matentzn
Copy link
Contributor

I saw Jim reviewed it 😷 sorry.

But the question remains..

@balhoff
Copy link
Contributor

balhoff commented Dec 19, 2023

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!

@anitacaron
Copy link
Collaborator Author

Why did you change the patterns for dated version iris?

There's already a date pattern in the next line in the file...

https://github.com/OBOFoundry/OBO-Dashboard/blob/559c0646ac876f404138c43823f1a61a65b85594/util/dashboard/fp_004.py#L33:L40

It wasn't checking for the purl anymore, that's why I changed it.

Copy link
Contributor

@matentzn matentzn left a 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*))?$")
Copy link
Contributor

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

@anitacaron anitacaron deleted the anitacaron/issue104 branch May 31, 2024 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

versioning check is too strict
3 participants