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

Add Cython as dependency #136

Open
bennati opened this issue Jun 28, 2023 · 1 comment · May be fixed by #137
Open

Add Cython as dependency #136

bennati opened this issue Jun 28, 2023 · 1 comment · May be fixed by #137

Comments

@bennati
Copy link
Contributor

bennati commented Jun 28, 2023

It seems cython is required in certain circumstances, see error below. Please add cython to requirements.txt.

08:50:03.364 [DefaultDispatcher-worker-1] ERROR org.ossreviewtoolkit.plugins.packagemanagers.python.Pip - Unable to determine dependencies for definition file '/builds/oss/oss-review-toolkit/ort-gitlab-ci/project/requirements.txt': IOException: Running 'python-inspector --python-version 310 --operating-system linux --json-pdt /tmp/ort-PythonInspector16980114111782037340/python-inspector8413559668320372377.json --analyze-setup-py-insecurely --requirement /builds/oss/oss-review-toolkit/ort-gitlab-ci/project/requirements.txt --verbose' in '/builds/oss/oss-review-toolkit/ort-gitlab-ci/project' failed with exit code 1:
Traceback (most recent call last):
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/python_inspector/resolve_cli.py", line 247, in resolve_dependencies
    resolution_result: Dict = resolver_api(
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/python_inspector/api.py", line 254, in resolve_dependencies
    resolution, purls = resolve(
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/python_inspector/api.py", line 313, in resolve
    resolved_dependencies, packages = get_resolved_dependencies(
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/python_inspector/api.py", line 351, in get_resolved_dependencies
    resolver_results = resolver.resolve(requirements=requirements, max_rounds=max_rounds)
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/resolvelib/resolvers.py", line 427, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/resolvelib/resolvers.py", line 239, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/resolvelib/resolvers.py", line 229, in _get_updated_criteria
    for requirement in self._p.get_dependencies(candidate=candidate):
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/python_inspector/resolution.py", line 639, in get_dependencies
    return list(self._iter_dependencies(candidate))
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/python_inspector/resolution.py", line 630, in _iter_dependencies
    for r in self.get_requirements_for_package(purl=purl, candidate=candidate):
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/python_inspector/resolution.py", line 509, in get_requirements_for_package_from_pypi_simple
    yield from get_requirements_from_python_manifest(
  File "/opt/python/versions/3.9.5/lib/python3.9/site-packages/python_inspector/resolution.py", line 299, in get_requirements_from_python_manifest
    yield from get_reqs_insecurely(
  File "/opt/python/versions/3.9.5/lib/python3.9/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 "/opt/python/versions/3.9.5/lib/python3.9/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 "/opt/python/versions/3.9.5/lib/python3.9/site-packages/python_inspector/setup_py_live_eval.py", line 117, in iter_requirements
    exec(file_contents, g)
  File "<string>", line 793, in <module>
  File "<string>", line 763, in setup_package
  File "<string>", line 520, in maybe_cythonize
RuntimeError: Cannot cythonize without Cython installed.
bennati added a commit to bennati/python-inspector that referenced this issue Jun 28, 2023
@bennati bennati linked a pull request Jun 28, 2023 that will close this issue
bennati added a commit to bennati/python-inspector that referenced this issue Jun 28, 2023
Closes aboutcode-org#136

Signed-off-by: Bennati, Stefano <[email protected]>
@pombredanne
Copy link
Member

That's a great find and rare case indeed.

bennati added a commit to bennati/python-inspector that referenced this issue Dec 1, 2023
Closes aboutcode-org#136

Signed-off-by: Bennati, Stefano <[email protected]>
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

Successfully merging a pull request may close this issue.

2 participants