-
Notifications
You must be signed in to change notification settings - Fork 6
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
Define parse_version
for broad compatibility with packaging
#32
Conversation
This will allow us to write a `parse_version` function that is compatible with versions of `packaging` both before and after v22.0
Codecov Report
@@ Coverage Diff @@
## master #32 +/- ##
==========================================
+ Coverage 96.46% 96.59% +0.12%
==========================================
Files 6 7 +1
Lines 368 382 +14
==========================================
+ Hits 355 369 +14
Misses 13 13
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
This restores the `LegacyVersion` behavior, which we depend on.
I'll drop these links for the context on I think it's a good solution since it covers all the current use cases and doesn't require a big rewrite. It'll be nice to be able to install this alongside packages that require the most recent |
I admittedly don't fully understand the need to retain the legacy version parsing. However as it seems to be a crucial part of your workflow, @goerz, I think this is a mutually-agreeable solution and am on board 👍 By the way - we'll have to update the README indicating just how many repos use this library one day. In our organization alone, we have about 100 repositories using docs-versions-menu. Overall we're very happy with it. Thanks again for your great work here! |
It's required because I'm putting all folder names in the
Wow! I'm glad it's getting some use! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks !
This allows us to go back to using `packaging` instead of `packvers` as the dependency for parsing folder names/version numbers. We'll have to depend on the internal `packaing.version._BaseVersion`, but we can test the behavior that we rely on in case `packaging` makes a breaking change to that behavior.
Just for completeness, pypa/packaging#669 is quite interesting and points to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand the issue better now and like the approach you chose here, sticking with packaging
and extending it for the purposes of docs-versions-menu
.
If/when the upstream library API changes, it can be revisited then.
The final approach here is clean and the code's intent is clear, I like it a lot |
Closes #27