Analysis with 0.9.7 fails with `cannot import name 'Feature' from 'setuptools'`
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
Reproduce the failure with the supplied command and the linked requirements.txt. Start at resolution.py in get_reqs_insecurely and parse_reqs_from_setup_py_insecurely, then follow setup_py_live_eval.py and iter_requirements where the traceback shows the import failure. Done means the project analyzes successfully with python-inspector 0.9.7 while the 0.9.6 behavior remains valid.
Written by the indexing model from the issue text.
Description
Running the python-inspector on this requirements.txt, fails with the following error.
The same project can successfully be analyzed using python-inspector 0.9.6.
The command I used is:
python-inspector --python-version 310 --operating-system linux --json-pdt result.json --analyze-setup-py-insecurely --requirement requirements.txt --verbose
Warning: ambiguous setup provider in /Volumes/src/oss/ort/plugins/package-managers/python/src/funTest/assets/projects/synthetic/python-inspector/.cache/python_inspector/extracted_sdists/itsdangerous-0.24/itsdangerous-0.24/setup.py: candidates are ['setuptools', 'distutils.core']defaulting to 'distutils.core'.
Traceback (most recent call last):
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/python_inspector/resolve_cli.py", line 247, in resolve_dependencies
resolution_result: Dict = resolver_api(
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/python_inspector/api.py", line 263, in resolve_dependencies
resolution, purls = resolve(
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/python_inspector/api.py", line 322, in resolve
resolved_dependencies, packages = get_resolved_dependencies(
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/python_inspector/api.py", line 360, in get_resolved_dependencies
resolver_results = resolver.resolve(requirements=requirements, max_rounds=max_rounds)
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/resolvelib/resolvers.py", line 546, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/resolvelib/resolvers.py", line 427, in resolve
failure_causes = self._attempt_to_pin_criterion(name)
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/resolvelib/resolvers.py", line 239, in _attempt_to_pin_criterion
criteria = self._get_updated_criteria(candidate)
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/resolvelib/resolvers.py", line 229, in _get_updated_criteria
for requirement in self._p.get_dependencies(candidate=candidate):
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/python_inspector/resolution.py", line 644, in get_dependencies
return list(self._iter_dependencies(candidate))
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/python_inspector/resolution.py", line 635, in _iter_dependencies
for r in self.get_requirements_for_package(purl=purl, candidate=candidate):
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/python_inspector/resolution.py", line 497, in get_requirements_for_package_from_pypi_simple
yield from get_reqs_insecurely(
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/python_inspector/resolution.py", line 277, in get_reqs_insecurely
yield from parse_reqs_from_setup_py_insecurely(setup_py=setup_py_location)
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/python_inspector/resolution.py", line 128, in parse_reqs_from_setup_py_insecurely
for req in iter_requirements(level="", extras=[], setup_file=setup_py):
File "/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/python_inspector/setup_py_live_eval.py", line 117, in iter_requirements
exec(file_contents, g)
File "<string>", line 6, in <module>
ImportError: cannot import name 'Feature' from 'setuptools' (/Users/bom1wa3/Library/Python/3.9/lib/python/site-packages/setuptools/__init__.py)
- 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