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

BUG: resolve_dependencies failures #1313

Open
tdruez opened this issue Jul 5, 2024 · 1 comment
Open

BUG: resolve_dependencies failures #1313

tdruez opened this issue Jul 5, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@tdruez
Copy link
Contributor

tdruez commented Jul 5, 2024

Using the latest release v34.7.0 on the SCIO setup.cfg file:

docker pull ghcr.io/nexb/scancode.io:latest
docker run --rm \
  ghcr.io/nexb/scancode.io:latest \
  sh -c "run resolve_dependencies https://github.com/nexB/scancode.io/blob/main/setup.cfg" \
  > results.json
...
INFO 2024-07-05 06:30:11.70 Step [get_packages_from_manifest] starting
INFO 2024-07-05 06:30:25.46 Pipeline failed
INFO Run[3ff9570e-2c9f-401f-8c98-7e6ee7bb48a4] Update Run instance with exitcode, output, and end_date
CommandError: Error during resolve_dependencies execution:
This package does not exist: teams

Traceback:
  File "/opt/scancodeio/scanpipe/pipelines/__init__.py", line 215, in execute
    step(self)
  File "/opt/scancodeio/scanpipe/pipelines/resolve_dependencies.py", line 87, in get_packages_from_manifest
    self.resolved_packages = resolve.get_packages(
                             ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/scanpipe/pipes/resolve.py", line 71, in get_packages
    if packages := resolve_manifest_resources(resource, package_registry):
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/scanpipe/pipes/resolve.py", line 47, in resolve_manifest_resources
    packages = get_packages_from_manifest(resource.location, package_registry) or []
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/scanpipe/pipes/resolve.py", line 125, in get_packages_from_manifest
    resolved_packages = resolver(input_location=input_location)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/scanpipe/pipes/resolve.py", line 144, in resolve_pypi_packages
    inspector_output = resolve_dependencies(
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/venv/lib/python3.12/site-packages/python_inspector/api.py", line 280, in resolve_dependencies
    resolution, purls = resolve(
                        ^^^^^^^^
  File "/opt/scancodeio/venv/lib/python3.12/site-packages/python_inspector/api.py", line 344, in resolve
    resolved_dependencies, packages = get_resolved_dependencies(
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/venv/lib/python3.12/site-packages/python_inspector/api.py", line 385, in get_resolved_dependencies
    resolver_results = resolver.resolve(requirements=requirements, max_rounds=max_rounds)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/venv/lib/python3.12/site-packages/resolvelib/resolvers.py", line 546, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/venv/lib/python3.12/site-packages/resolvelib/resolvers.py", line 397, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/opt/scancodeio/venv/lib/python3.12/site-packages/resolvelib/resolvers.py", line 148, in _add_to_criteria
    matches = self._p.find_matches(
              ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/scancodeio/venv/lib/python3.12/site-packages/python_inspector/resolution.py", line 612, in find_matches
    candidates = sorted(
                 ^^^^^^^
  File "/opt/scancodeio/venv/lib/python3.12/site-packages/python_inspector/resolution.py", line 595, in _iter_matches
    raise NoVersionsFound(f"This package does not exist: {name}")
@tdruez tdruez added the bug Something isn't working label Jul 5, 2024
@AyanSinhaMahapatra
Copy link
Contributor

AyanSinhaMahapatra commented Jul 5, 2024

@tdruez python-inspector is only supporting setup.py and requirements.txt for dynamic package resolution, everything else is not supported (pyproject.toml/setup.cfg).
From the README:

* parse various requirements.txt files and setup.py files as input for resolving dependencies.

See also aboutcode-org/python-inspector#153

But we should not fail like this on the python-inspector side if we don't have a supported manifest, will open an issue there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants