[BUG] DistributionNotFound does not handle name normalization
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
setuptools version
setuptools
Python version
3.x
OS
Any
Additional environment information
No response
Description
pkg_resources.DistributionNotFound: The 'a.b<3,>=2' distribution was not found and is required . Which is true, but a-b is present. Per PEP-503, installers and backends can normalize package names, so when we search, we should look for normalized names too.
Expected behavior
We accept both a_b and a.b for requirements.
How to Reproduce
Create a package with a_b and add a package that depends on it in requires as a.b.
Output
👍
Contributor guide
No contributing guide indexed for this repository
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 with the pkg_resources DistributionNotFound lookup described in the report and reproduce the case using packages named a_b and a.b. Trace how the requirement name is compared with the installed distribution name. Done means requirements using a_b and a.b both resolve to the installed distribution, with coverage for the reproduced case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100