Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running python-inspector gives KeyError: 'dictionary is empty' #169

Open
sschuberth opened this issue Jan 29, 2024 · 3 comments
Open

Running python-inspector gives KeyError: 'dictionary is empty' #169

sschuberth opened this issue Jan 29, 2024 · 3 comments

Comments

@sschuberth
Copy link
Contributor

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

on https://github.com/nordic-institute/X-Road-Metrics/blob/ce07b95f1fc6fe8236a1d4f6e3bed95b84d313a4/anonymizer_module/test_requirements.txt, see

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()))]
@pombredanne
Copy link
Member

@sschuberth Thanks for the report!

@sschuberth
Copy link
Contributor Author

Looks like the issue disappeared with python-inspector release 0.11.0.

@sschuberth
Copy link
Contributor Author

Sorry, no, I was not seeing the issue for another reason, but it's still there.

@sschuberth sschuberth reopened this Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants