Skip to content

Fix #208: Introduce VersionInfo.isvalid() function #209

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

Merged
merged 1 commit into from
Dec 10, 2019

Conversation

tomschr
Copy link
Member

@tomschr tomschr commented Dec 8, 2019

This PR fixes #208 and contains:

  • VersionInfo.isvalid(cls, version:str) -> bool
  • Add test case
  • Describe function in documentation; also clarified in the "Creating a Version" what happens when the user pass an invalid version string.

As I expect some discussions and as this is still WIP, I haven't completed the CHANGELOG entry yet. 😉


Update 2019-12-08: Add entry in CHANGELOG.rst.


Update 2019-12-09: Insert check subcommand into pysemver command.

@tomschr tomschr added the Enhancement Not a bug, but increases or improves in value, quality, desirability, or attractiveness label Dec 8, 2019
@tomschr tomschr requested a review from a team December 8, 2019 09:39
@tomschr tomschr self-assigned this Dec 8, 2019
@s-celles
Copy link
Member

s-celles commented Dec 8, 2019

I'm fine with both with naming and the fact it's a class method.

@tomschr tomschr force-pushed the feature/208-isvalid branch from 55f5822 to e882af5 Compare December 8, 2019 10:25
@tomschr
Copy link
Member Author

tomschr commented Dec 8, 2019

Ok, I've updated the commit and inserted an entry for the CHANGELOG.

@s-celles
Copy link
Member

s-celles commented Dec 8, 2019

Waiting some days to have others @python-semver/reviewers feedback before merging.

Copy link
Member

@ppkt ppkt left a comment

Choose a reason for hiding this comment

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

LGTM :)
Maybe you could add this command to CLI app as well (e.g. subcommand "check")?

@tomschr
Copy link
Member Author

tomschr commented Dec 9, 2019

@ppkt Good point Karol! 👍 I've never thought about this. 😄

Ok, will amend this PR

@tomschr tomschr force-pushed the feature/208-isvalid branch 3 times, most recently from 3df41bc to 9b8c896 Compare December 9, 2019 11:38
@tomschr
Copy link
Member Author

tomschr commented Dec 9, 2019

@ppkt Karl, I've added this subcommand now and extended the manpage. However, I've realized that I added is as is-valid instead of check. I will fix that.

@tomschr tomschr force-pushed the feature/208-isvalid branch 2 times, most recently from 952eb46 to df82b34 Compare December 9, 2019 11:48
* VersionInfo.isvalid(cls, version:str) -> bool
* Add test case
* Describe function in documentation
* Amend pysemver script with "check" subcommand
* Update manpage (pysemver.rst)
* Update `CHANGELOG.rst`
@tomschr tomschr force-pushed the feature/208-isvalid branch from df82b34 to 18e332a Compare December 9, 2019 12:14
@tomschr tomschr requested a review from ppkt December 9, 2019 12:18
@tomschr
Copy link
Member Author

tomschr commented Dec 9, 2019

I've also added testcase to test the check subcommand. Feel free to comment. 😉

@s-celles
Copy link
Member

s-celles commented Dec 9, 2019

great idea to also add such command to cli also!

@tomschr
Copy link
Member Author

tomschr commented Dec 9, 2019

@scls19fr, @ppkt I realized, the implementation of the subcommands are a bit suboptimal. I will optimize this in a separate commit. 😉

Any other wishes, comments, ideas, etc.?

@ppkt
Copy link
Member

ppkt commented Dec 9, 2019

Looks really great, thank you :)

@s-celles s-celles merged commit f2c23f6 into python-semver:master Dec 10, 2019
@s-celles
Copy link
Member

Thanks @tomschr for this new feature. Thanks @ppkt for your review.

@tomschr tomschr deleted the feature/208-isvalid branch December 10, 2019 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Not a bug, but increases or improves in value, quality, desirability, or attractiveness
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Case: Introduce a "isvalid()" function to check for valid semver version
3 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