Skip to content

Conversation

@bearomorphism
Copy link
Collaborator

@bearomorphismbearomorphism commented Jun 12, 2025

Description

Related issue: #950

Checklist

Comment on lines +67 to +69
(("1.0.0-reallyweird", "PATCH", "reallyweird", 0, None), "1.0.0-reallyweird1"),
(("v0.7.1-release", "PATCH", "release", 0, None), "0.7.1-release1"),
(("v0.0.1-SNAPSHOT", "PATCH", "SNAPSHOT", 0, None), "0.0.1-snapshot1"),
Copy link
CollaboratorAuthor

@bearomorphismbearomorphismJun 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lee-W I'm not entirely sure if these test cases are correct. Could you help to review?

@bearomorphismbearomorphismforce-pushed the bear-fix-semver-not-fully-covered branch from 877fcd6 to da46193CompareJune 13, 2025 13:09
@codecov
Copy link

codecovbot commented Jun 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.25%. Comparing base (120d514) to head (bb48144).
⚠️ Report is 805 commits behind head on master.

Additional details and impacted files
@@ Coverage Diff @@## master #1548 +/- ## ========================================== + Coverage 97.33% 98.25% +0.91%  ========================================== Files 42 58 +16 Lines 2104 2696 +592 ========================================== + Hits 2048 2649 +601 + Misses 56 47 -9 
FlagCoverage Δ
unittests98.25% <100.00%> (+0.91%)⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bearomorphismbearomorphism changed the title WIP fix semver not fully coveredfix semver not fully coveredAug 13, 2025
@bearomorphismbearomorphism marked this pull request as ready for review August 13, 2025 01:30
@Lee-WLee-W added this to the 4.9.0 milestone Aug 17, 2025
Comment on lines +67 to +69
(("1.0.0-reallyweird", "PATCH", "reallyweird", 0, None), "1.0.0-reallyweird1"),
(("v0.7.1-release", "PATCH", "release", 0, None), "0.7.1-release1"),
(("v0.0.1-SNAPSHOT", "PATCH", "SNAPSHOT", 0, None), "0.0.1-snapshot1"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(("1.0.0-reallyweird", "PATCH", "reallyweird", 0, None), "1.0.0-reallyweird1"),
(("v0.7.1-release", "PATCH", "release", 0, None), "0.7.1-release1"),
(("v0.0.1-SNAPSHOT", "PATCH", "SNAPSHOT", 0, None), "0.0.1-snapshot1"),
(("1.0.0-reallyweird", "PATCH", "reallyweird", 0, None), "1.0.1-reallyweird1"),
(("v0.7.1-release", "PATCH", "release", 0, None), "0.7.2-release1"),
(("v0.0.1-SNAPSHOT", "PATCH", "SNAPSHOT", 0, None), "0.0.2-snapshot1"),

I feel they probably should be this instead?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need some time to figure out how to adjust the logic.

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the version number already appended at the end of the version string?

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lee-W a gentle reminder for this discussion

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly don't remember... @woile any idea?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also it might be a good idea to make these named tuple. too hard to read...

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree the tests can be more readable. I had #1598 that attempts to make the tests read better.

I can make the NamedTuple change in that PR.


# See https://github.com/pypa/packaging/blob/14b83e15dbb9caa87c63646ba7808b2b5e460ce6/src/packaging/version.py#L117
# TODO: add more test cases for this pattern
_VERSION_PATTERN=r"""^\s*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to note is that Python does not use semver. It exists before semver

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I add any comments here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a bad idea. more like a reminder that we can not fully depend on python packaging version

@bearomorphism
Copy link
CollaboratorAuthor

I will update this PR this week when I have bandwidth

@bearomorphismbearomorphismforce-pushed the bear-fix-semver-not-fully-covered branch from da46193 to 3081fffCompareSeptember 8, 2025 08:34
@Lee-WLee-W modified the milestones: 4.9.0, 4.9.1Sep 9, 2025
@Lee-WLee-W deleted the branch commitizen-tools:masterSeptember 9, 2025 06:09
@Lee-WLee-W closed this Sep 9, 2025
@bearomorphism
Copy link
CollaboratorAuthor

Maybe we can adjust the workflow. Several PRs got closed just because the target branch is deleted

@Lee-WLee-W reopened this Sep 9, 2025
@Lee-WLee-W changed the base branch from v4-9-0-test to masterSeptember 9, 2025 14:22
@Lee-W
Copy link
Member

Lee-W commented Sep 9, 2025

Yep, this was a temporary workflow. we usually don't receive this many PR and don't review this fast. Maybe worth rethink it to make a rc to avoid what we encountered yesterday as well

@Lee-WLee-W removed this from the 4.9.1 milestone Sep 9, 2025
@Lee-WLee-W added this to the 4.9.2 milestone Sep 9, 2025
@bearomorphismbearomorphismforce-pushed the bear-fix-semver-not-fully-covered branch from 3081fff to 8ee1dbeCompareSeptember 13, 2025 03:38
@bearomorphismbearomorphismforce-pushed the bear-fix-semver-not-fully-covered branch from 8ee1dbe to bb48144CompareSeptember 13, 2025 09:45
(?P<release>[0-9]+(?:\.[0-9]+)*) # release segment
(?P<pre> # pre-release
[-_\.]?
# BEGIN different from packaging.version.py
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added those comments.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@bearomorphism@Lee-W