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

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

Open
3 tasks done
jdevera-hj opened this issue Oct 16, 2023 · 3 comments
Open
3 tasks done
Assignees
Labels
bug Something isn't working
Milestone

Comments

@jdevera-hj
Copy link

jdevera-hj commented Oct 16, 2023

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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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/[email protected]/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.
@Nekmo Nekmo self-assigned this Oct 26, 2023
@Nekmo
Copy link
Owner

Nekmo commented Oct 26, 2023

I apologize for the delay, I haven't had the PC available to look at this, but I hope to be able to debug it this week to give you an answer as soon as possible, thank you!

@Nekmo Nekmo added the bug Something isn't working label Oct 28, 2023
@Nekmo Nekmo added this to the v0.2.3 milestone Oct 28, 2023
@Nekmo
Copy link
Owner

Nekmo commented Oct 28, 2023

The bug has been confirmed, thanks!

@Nekmo
Copy link
Owner

Nekmo commented Oct 28, 2023

@jdevera-hj, there is already a version available to try that fixes this bug. It is still under testing. If you want you can check if it works for you. Thank you!

https://github.com/Nekmo/pip-rating/tree/pip-rating-50

Nekmo added a commit that referenced this issue Oct 29, 2023
Nekmo added a commit that referenced this issue Oct 30, 2023
Nekmo added a commit that referenced this issue Nov 28, 2023
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