[BUG] Removed reliance on LegacyVersion from pkg_resources can break pip modules
- Dominant language
- Python
- Stars
- 15.7k
- Forks
- 5.6k
- Avg merge
- 2d 44m
- Merged PRs (30d)
- 80
Description
Description
This PR [https://github.com/pypa/setuptools/pull/2822] remove the reliance on LegacyVersion.
Since then, the pip modules could be broken, if there is an InvalidVersion (before, it was only a LegacyVersion) on the pip repo you're using.
Since we were using a custom pip repo (mirror + some custom packages), with some old version, some method on the pip modules would not work. In particular:
- pip.list_all_versions
- pip.installed (this call pip.list_all_versions)
- Probably some others method that call pip.list_all_versions
Setup
Nothing really specific to salt.
Steps to Reproduce the behavior
Have an invalid version in the pip repo history, and then you can't even install the current latest version (which could be valid), since the list_all_versions is failing due to this.
Expected behavior
At least ignore the non-standard version, except of failing completly
Versions Report
3006.8
I will provide a PR soon, since it was quite critical (and we couldn't remove the package from the repo)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at pip.list_all_versions and its caller pip.installed, then trace how InvalidVersion values from the repository history are handled. Reproduce the failure with an invalid version while a valid latest version is available. Done means invalid versions are ignored rather than breaking version listing or installation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100