Accept `types.ModuleType` as a distribution identifier
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start at the importlib.metadata.distribution() entry point and inspect how distribution identifiers are resolved, with attention to types.ModuleType and shadowed modules in sys.path. Determine how the originating distribution should be found when a module is passed, including the no-distribution case. Done means a module can be accepted as an identifier and the behavior is covered by tests for shadowed modules.
Written by the indexing model from the issue text.
Description
I have recently ran into the issue where the importable module did not come from the distribution metadata found by importlib.metadata. This was because the distribution modules were shadowed in sys.path, which can happen often in test environments.
It would be nice if we could pass a module to importlib.metadata.distribution(), and have it find the distribution where that module originates from, if any.
- Dominant language
- Python
- Stars
- 142
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
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.
More from python/importlib_metadata
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
python/importlib_metadata#535 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
python/importlib_metadata#528 · 4 comments ·
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
python/importlib_metadata#526 · 6 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
python/importlib_metadata#525 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
python/importlib_metadata#540 · 1 comment ·
All issues in python/importlib_metadata
Similar issues
-
Add: hunch Open
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
AbdelStark/awesome-typesafe#104 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
DiamondLightSource/dodal#2211 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
openml/openml-python#1749 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sipyourdrink-ltd/bernstein#6191 ·