Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
runner.conda: Explicitly handle our package versions which are invali…
…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>
- Loading branch information