Skip to content

(not semver) Allow parsing of partial version string #108

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

Closed
wants to merge 1 commit into from
Closed

(not semver) Allow parsing of partial version string #108

wants to merge 1 commit into from

Conversation

jimmy-lt
Copy link

@jimmy-lt jimmy-lt commented Oct 7, 2018

Allow semver to parse partial version string.

When only a single digit is given, it is assumed to be the major version: 1 is equivalent to 1.0.0.

When two digits are given, it is assumed to be the major and minor parts of the version string: 1.2 is equivalent to 1.2.0.

@ppkt
Copy link
Member

ppkt commented Oct 8, 2018

@spack971 Thank you for your PR. While it looks interesting, this feature is not compatible with semver: https://semver.org/#spec-item-2. Please check discussion under issue #70.

@jimmy-lt
Copy link
Author

jimmy-lt commented Oct 8, 2018

@ppkt Fair point. I'll adapt the pull request to define a parse_partial function for this purpose.

Add the `try_parse` function allowing `semver` to parse partial
version string.

When only a single digit is given, it is assumed to be the major
version: `1` is equivalent to `1.0.0`. When two digits are given, it
is assumed to be the major and minor parts of the version string:
`1.2` is equivalent to `1.2.0`.

Signed-off-by: Jimmy Thrasibule <jimmy@thrasibule.mx>
@jimmy-lt
Copy link
Author

jimmy-lt commented Oct 8, 2018

Added a new function named try_parse which will try to parse a complete or partial version string.

@s-celles
Copy link
Member

s-celles commented Oct 8, 2018

I will personally name such a function parse_... because it will be easier to find it when using tab completion with IPython for example

@jimmy-lt
Copy link
Author

jimmy-lt commented Oct 8, 2018

@scls19fr well that was my goal but I couldn't come with a nice name. I'm open to suggestions.

@s-celles s-celles changed the title Allow parsing of partial version string (not semver) Allow parsing of partial version string Mar 24, 2019
@tomschr tomschr added the Not Semver This issue does not belong to semver or is an invalid issue label Nov 24, 2019
@tomschr
Copy link
Member

tomschr commented Jan 19, 2020

That issue looks very similar to #210 which I've done lately. We've come to the conclusion that we do not want to support a function which doesn't adhere to the semver specification. That means, we avoid partial parsing of a version string.

However, to support our developers, we've think to add some recommendations to our documentation is a good idea. As such, I've written a short section into our documentation (see PR #215: "Dealing with Invalid Versions").

@scls19fr With that background, I think, we can close this issue, right?

@tomschr tomschr added the Wontfix Invalid, out-of-scope, or other inappropriate issues label Apr 24, 2020
@tomschr
Copy link
Member

tomschr commented Apr 24, 2020

Closing it as wontfix. There is already a section in the documentation about dealing with invalid versions.

@tomschr tomschr closed this Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not Semver This issue does not belong to semver or is an invalid issue Wontfix Invalid, out-of-scope, or other inappropriate issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy