working_set drops python_version marker
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 1
Description
Scenario
I'm working on a project that uses python 3.6.x with pytest 3.1.x using the latest release of setuptools and pip.
I've got a pytest plugin that isn't being loaded/registered because pytest ignores it due to entrypoint.load() failing with DistributionNotFound. The given information Entrypoint.load() and therefore to working_set is valid. The problem is that the given information is wrong.
I'm attempting to use cnx-litezip-1.2.0 in my project, which is correctly registered as a pytest plugin. cnx-litezip depends on cnxml, which in-turn has a dependency: pathlib;python_version<='2.7'. The issue seems to be that the working_set dist object for drops the python_version marker.
>>> dist = working_set.by_key.get('cnxml')
>>> dist
cnxml 2.0.0 (/usr/local/lib/python3.6/site-packages)
>>> dist.requires()
[Requirement.parse('pathlib')]
When it really should be, but is not:
>>> dist.requires()
[Requirement.parse('pathlib; python_version <= "2.7"')]
Workaround
The temporary workaround to this issue has been to simply install the missing package, but this isn't ideal, seeing as pathlib is included in the standard library.
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
Reproduce the report with Python 3.6, cnxml, and the pathlib;python_version<='2.7' dependency, then inspect the working_set distribution and its requires() result. Trace how the dependency metadata reaches working_set and preserve the environment marker; done when requires() returns the marker and the pytest plugin loads without installing pathlib manually.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100