Skip to content

Internal (not in pypi) packages not ignored, even when instructed to #50

Description

@jdevera-hj

Command that causes the issue

pip-rating analyze-file src/requirements_prod.in
pip-rating analyze-file src/requirements_prod.in --ignore-package hj-nekobasu
pip-rating analyze-file src/requirements_prod.in --ignore-package hj-nekobasu==3.0.7

Expected behavior

I would expect for dependencies that cannot be found to be listed as errors in the report, which it does:

ERROR: Getting report for hj-nekobasu==3.0.7 failed with output:
ERROR: Could not find a version that satisfies the requirement hj-nekobasu==3.0.7 (from versions: none)
ERROR: No matching distribution found for hj-nekobasu==3.0.7

And then for it to proceed without trying further.

Actual behavior

The tool seems to have kept on trying to get info about the packages that are not available and then stopped running.

Traceback

Traceback (most recent call last):
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/pipper.py", line 281, in
_get_package_report
    out = stream_bash_command(args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/pipper.py", line 85, in
stream_bash_command
    raise subprocess.CalledProcessError(retcode, args, output=out)
subprocess.CalledProcessError: Command '['/Users/jacobo.devera/.local/pipx/venvs/pip-rating/bin/python', '-m', 'pip', 'install',
'-qq', '--no-deps', '--ignore-installed', '--disable-pip-version-check', '--dry-run', '--cache-dir',
'/Users/jacobo.devera/Library/Caches/pip/wheels/pip-rating', '--report', '-', 'hj-nekobasu==3.0.7']' returned non-zero exit
status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jacobo.devera/.local/bin/pip-rating", line 8, in <module>
    sys.exit(manage())
             ^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pip_rating/management.py", line 206, in
manage
    catch(cli)()
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pip_rating/exceptions.py", line 45, in
wrap
    fn(*args, **kwargs)
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pip_rating/management.py", line 160, in
analyze_file
    results.show_results(dependencies, format_name)
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pip_rating/results.py", line 294, in
show_results
    self.show_packages_results(dependencies)
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pip_rating/results.py", line 307, in
show_packages_results
    global_rating_score = self.get_global_rating_score(dependencies)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pip_rating/results.py", line 277, in
get_global_rating_score
    global_rating_score = dependencies.get_global_rating_score()
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pip_rating/dependencies.py", line 137, in
get_global_rating_score
    packages = dict(self.get_packages()).values()
                    ^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pip_rating/dependencies.py", line 124, in
get_packages
    for dependency_node in self.dependencies_tree.children:
                           ^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/functools.py", line
1001, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pip_rating/dependencies.py", line 105, in
dependencies_tree
    for package, version in self.version_solution.decisions.items():
                            ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/functools.py", line
1001, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pip_rating/dependencies.py", line 94, in
version_solution
    return solver.solve()
           ^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/libs/mixology/version_solver.py",
line 74, in solve
    if not self._run():
           ^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/libs/mixology/version_solver.py",
line 90, in _run
    next_package = self._choose_package_version()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/libs/mixology/version_solver.py",
line 359, in _choose_package_version
    term = self._next_term_to_try()
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/libs/mixology/version_solver.py",
line 345, in _next_term_to_try
    zip(unsatisfied, self._threadpool.map(_get_min, unsatisfied))
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File
"/opt/homebrew/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line
367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File
"/opt/homebrew/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line
774, in get
    raise self._value
  File
"/opt/homebrew/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line
125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File
"/opt/homebrew/Cellar/python@3.11/3.11.6/Frameworks/Python.framework/Versions/3.11/lib/python3.11/multiprocessing/pool.py", line
48, in mapstar
    return list(map(*args))
           ^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/libs/mixology/version_solver.py",
line 331, in _get_min
    versions = self._source.versions_for(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/libs/mixology/package_source.py",
line 77, in versions_for
    return self._versions_for(package, constraint)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/package_source.py", line 185, in
_versions_for
    self.discover_and_add(package.req.__str__())
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/package_source.py", line 146, in
discover_and_add
    to_create = discover_dependencies_and_versions(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/pipper.py", line 462, in
discover_dependencies_and_versions
    report = _get_package_report(
             ^^^^^^^^^^^^^^^^^^^^
  File "/Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pipgrip/pipper.py", line 289, in
_get_package_report
    raise RuntimeError("Failed to get report for {}".format(package))
RuntimeError: Failed to get report for hj-nekobasu==3.0.7

Pip-rating version

pip-rating 0.2.2
  🔝 This is the latest version.
  🐍 Python version: 3.11.6
  💻 Platform: macOS-13.5.2-arm64-arm-64bit
  📦 Installation path: /Users/jacobo.devera/.local/pipx/venvs/pip-rating/lib/python3.11/site-packages/pip_rating
  📁 Current path: /Users/jacobo.devera/devel

Other details

pip-rating installed via pipx.

Checklist

  • The error is in the project's code, and not in my own.
  • I have searched for this issue before posting it and there isn't an open duplicate.
  • I ran pip install -U pip-rating and triggered the bug in the latest version.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions