Running `python-inspector` gives `KeyError: 'dictionary is empty'`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the reported python-inspector command against the linked X-Road-Metrics test_requirements.txt and setup.py. The traceback points into python_inspector/resolve_cli.py and python_inspector/api.py, with the underlying failure in resolvelib. Done means the resolver handles this conflicting pymongo/pymongo-stubs case without surfacing KeyError: 'dictionary is empty'.
Written by the indexing model from the issue text.
Description
This comes from ORT running
python-inspector --python-version 311 --operating-system linux --json-pdt /tmp/ort-PythonInspector1958014688763264125/python-inspector6282585536190674410.json --analyze-setup-py-insecurely --requirement /var/jenkins_home/workspace/ORT@tmp/project/source/anonymizer_module/test_requirements.txt --setup-py /var/jenkins_home/workspace/ORT@tmp/project/source/anonymizer_module/setup.py --verbose
PIP failed to resolve dependencies for path 'anonymizer_module/test_requirements.txt': IOException: Running 'python-inspector --python-version 311 --operating-system linux --json-pdt /tmp/ort-PythonInspector1958014688763264125/python-inspector6282585536190674410.json --analyze-setup-py-insecurely --requirement /var/jenkins_home/workspace/ORT@tmp/project/source/anonymizer_module/test_requirements.txt --setup-py /var/jenkins_home/workspace/ORT@tmp/project/source/anonymizer_module/setup.py --verbose' in '/var/jenkins_home/workspace/ORT@tmp/project/source/anonymizer_module' failed with exit code 1:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/resolvelib/resolvers.py", line 316, in _backjump
name, candidate = broken_state.mapping.popitem()
KeyError: 'dictionary is empty'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/python_inspector/resolve_cli.py", line 253, in resolve_dependencies
resolution_result: Dict = resolver_api(
File "/usr/local/lib/python3.10/dist-packages/python_inspector/api.py", line 279, in resolve_dependencies
resolution, purls = resolve(
File "/usr/local/lib/python3.10/dist-packages/python_inspector/api.py", line 341, in resolve
resolved_dependencies, packages = get_resolved_dependencies(
File "/usr/local/lib/python3.10/dist-packages/python_inspector/api.py", line 379, in get_resolved_dependencies
resolver_results = resolver.resolve(requirements=requirements, max_rounds=max_rounds)
File "/usr/local/lib/python3.10/dist-packages/resolvelib/resolvers.py", line 546, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/usr/local/lib/python3.10/dist-packages/resolvelib/resolvers.py", line 434, in resolve
success = self._backjump(causes)
File "/usr/local/lib/python3.10/dist-packages/resolvelib/resolvers.py", line 318, in _backjump
raise ResolutionImpossible(causes)
resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=<Requirement('pymongo==3.10.1')>, parent=None), RequirementInformation(requirement=<Requirement('pymongo<4.0,>=3.11')>, parent=Candidate(name='pymongo-stubs', version=<Version('0.2.0')>, extras=set())), RequirementInformation(requirement=<Requirement('pymongo==3.10.1')>, parent=None), RequirementInformation(requirement=<Requirement('pymongo<4.0,>=3.11')>, parent=Candidate(name='pymongo-stubs', version=<Version('0.1.0')>, extras=set()))]
- Dominant language
- Python
- Stars
- 23
- Forks
- 29
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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 aboutcode-org/python-inspector
-
`packages` is empty when using a non-pypi.org simple index (e.g. Sonatype Nexus)Possibly taken @avika269 claimed this 6 days ago. Open
Difficulty 3/5 Half a day Newbie friendliness 62/100
aboutcode-org/python-inspector#268 · 2 comments ·
-
InconsistentCandidate: Pre-Release not allowMay be free again @Anurag-S1ngh claimed this 25 days ago, and no pull request is open. Openbug design nice-to-have
Difficulty 4/5 3-5 days Newbie friendliness 35/100
aboutcode-org/python-inspector#257 · 1 comment ·
-
Python Inspector version 0.15.0 contains the wrong version stringMay be free again @Anurag-S1ngh claimed this 18 days ago, and no pull request is open. Open
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
aboutcode-org/python-inspector#253 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
aboutcode-org/python-inspector#246 · 2 comments · 2 reactions ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
aboutcode-org/python-inspector#242 · 1 comment ·
All issues in aboutcode-org/python-inspector
Similar issues
-
opensubtitlescom: provider rejects pt-PT even though its own converter maps itPossibly taken @paulo-0308 claimed this today. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Diaoul/subliminal#1405 ·
-
Internal ErrorOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
frappe/frappe_docker#2071 ·
Maintainers usually reply within 1 day
-
bug python
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
traceloop/openllmetry#4717 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
The-Pocket/PocketFlow#161 ·
-
comp/desktop P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#157702 ·
Maintainers usually reply within 1 day