-
Notifications
You must be signed in to change notification settings - Fork 40
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
_clean_version. with semantic version with underscore returns wrong version #138
Comments
This looks correct to me. In what way do you believe it is wrong? |
If the version of a module is v1.0.0_03, then the version is not v1.0.3. See the linked ticket for the user report. |
@karenetheridge |
I don't think that's how it works. The concept of alpha/trial doesn't exist in canonical versions, so the underscore is removed and note the PV value:
|
That's a v-string, not a version object. |
It is still equivalent to version v1.0.3 as the underscore does not have semantic value in any versions since version.pm 0.9915. |
For further edification: https://blogs.perl.org/users/grinnz/2018/04/a-guide-to-versions-in-perl.html |
I have read the guide to versions already and I have read the section about "Underscores in Versions" again. It seems that I have done something wrong because I haven't followed the recommendation not to use underscores in tuple versions. But my use case remains: How to specify the 3rd trial release of a Semantic Versioning would allow this |
The indication of a trial release is not required to be done through the version. The most compatible and consistent way to achieve that is to to release with a module version of 'v1.0.0' and include -TRIAL3 at the end of the archive name, and a release_status of 'testing'. (modern authoring tools will automate the release status and -TRIAL when told to do a trial release, but I don't know if any will automate numbered trials.) |
An option if you wish to do it through the pure version, though not recommended because it is not consistently interpreted, is to append another segment to the version and include an underscore in it somewhere. |
This path overrides CPAN::Meta::Converter::_clean_version so that the string in the the `provides` is passed on literally instead of interpreted. If you use something like v1.0.0_02, you get the same string back. This is despite the wisdom of using that (see the GitHub thread). This is related to Perl-Toolchain-Gang/CPAN-Meta#138 which makes the same change (but has not been merged). Note that all of this depends on the `provides` section having the right value. If you generate META.json or META.yaml with the current CPAN::Meta, it may modify the version value that it puts under `provides` even though the top-level `version` is unmolested. That is, this fix is half the fix and the rest depends on the distro. If this really bugs you, you'll have to hand-edit the META.* until the other side of the fix is in.
This is related to briandfoy/cpan-mini-inject#11. It seems that
_clean_version
does the wrong thing with semantic versions that have a dev component:The text was updated successfully, but these errors were encountered: