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

feat: add remove= postprocess to regex #828

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Conversation

henryiii
Copy link
Collaborator

This adds the ability to post-process regex to remove "dev0" or similar. Closes #765.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
Copy link

codecov bot commented Jul 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.68%. Comparing base (625046f) to head (c0ffd57).
Report is 64 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #828      +/-   ##
==========================================
+ Coverage   83.63%   83.68%   +0.04%     
==========================================
  Files          74       74              
  Lines        4192     4204      +12     
==========================================
+ Hits         3506     3518      +12     
  Misses        686      686              

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

@LecrisUT
Copy link
Collaborator

LecrisUT commented Jul 26, 2024

Was looking if this affects SKBUILD_PROJECT_VERSION

cache_config["SKBUILD_PROJECT_VERSION"] = version.base_version

Shouldn't this one be .public? Fedora packaging uses the 1:a.b.c format to define epoch (enforcing to update to a lower version than the latest)

@henryiii
Copy link
Collaborator Author

The “base version” is the public version of the project without any pre or post release markers.

Isn't that what we want?

1:a.b.c

I think you mean 1!a.b.c?

As to the epoch, it is included in both, which is probably not ideal for us, as CMake won't be able to understand an epoch.

@henryiii
Copy link
Collaborator Author

Was looking if this affects SKBUILD_PROJECT_VERSION

Yes, it should, the result of the dynamic metadata plugin is used as the version.

@LecrisUT
Copy link
Collaborator

The “base version” is the public version of the project without any pre or post release markers.

Isn't that what we want?

There is an example of public and base_version when it comes to epoch in the link I posted last. I believe the pre and post there refer only to suffix part.

1:a.b.c

I think you mean 1!a.b.c?

Python wise, yes. Was just mentioning because there could be a synchronization between those that might be used (after changing : to ! as needed)

@henryiii
Copy link
Collaborator Author

The examples are misleading, I've made pypa/packaging#818 to clarify the examples. Both of them include the epoch. Generally, the epoch is the most important version number (more than even the major number), so that's probably why it's always included. We could easily avoid it by manually constructing the number, though, since CMake won't be able to parse it.

@henryiii henryiii merged commit ae0ce3c into main Jul 26, 2024
51 checks passed
@henryiii henryiii deleted the henryiii/feat/remove branch July 26, 2024 15:40
@LecrisUT
Copy link
Collaborator

Ah indeed, the code right beneath it makes it more obvious :D

henryiii added a commit that referenced this pull request Jul 26, 2024
See #828. CMake
will not understand the epoch, so not including it. It's still in
`SKBUILD_PROJECT_FULL_VERSION`.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
henryiii added a commit that referenced this pull request Jul 29, 2024
See #828. CMake
will not understand the epoch, so not including it. It's still in
`SKBUILD_PROJECT_FULL_VERSION`.

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
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.

Regex support for more complex structures?
2 participants