runner.conda: Explicitly handle our package versions which are invalid by PEP-440#286
Merged
runner.conda: Explicitly handle our package versions which are invalid by PEP-440#286
Conversation
…d by PEP-440
Our nextstrain-base Conda package versions are not PEP-440 compliant, so
we inadvertently relied on packaging.version.parse_version() falling
back to its LegacyVersion class when it encountered an InvalidVersion
error. LegacyVersion was dropped, however, in packaging 22.0 (December
2022).¹ This resulted in seeing the InvalidVersion error during runtime
update, e.g.:
packaging.version.InvalidVersion: Invalid version: '20221019T172207Z'
To avoid that, we start handling InvalidVersion ourselves and produce a
valid proxy version instead with reasonable comparison semantics similar
to LegacyVersion.
The new version handling is more than strictly necessary for our current
package versions (which could just be simpler string comparisons), but
it allows us more leeway to change package versioning in the future if
need be without affecting existing installs of Nextstrain CLI. I didn't
want to vendor LegacyVersion itself because it's fairly complex and
tangled with the implementation of packaging.version.
Resolves <#285>.
¹ <https://packaging.pypa.io/en/latest/changelog.html>
Contributor
Author
|
Passes CI and installing the build from this PR fixes |
Contributor
|
Thanks for fixing this @tsibley! Installing the build from this PR fixes the issue for me as well. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Our nextstrain-base Conda package versions are not PEP-440 compliant, so we inadvertently relied on packaging.version.parse_version() falling back to its LegacyVersion class when it encountered an InvalidVersion error. LegacyVersion was dropped, however, in packaging 22.0 (December 2022).¹ This resulted in seeing the InvalidVersion error during runtime update, e.g.:
To avoid that, we start handling InvalidVersion ourselves and produce a valid proxy version instead with reasonable comparison semantics similar to LegacyVersion.
The new version handling is more than strictly necessary for our current package versions (which could just be simpler string comparisons), but it allows us more leeway to change package versioning in the future if need be without affecting existing installs of Nextstrain CLI. I didn't want to vendor LegacyVersion itself because it's fairly complex and tangled with the implementation of packaging.version.
Resolves #285.
¹ https://packaging.pypa.io/en/latest/changelog.html
Testing