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

No build error message very verbose #2519

Closed
konstin opened this issue Mar 18, 2024 · 5 comments · Fixed by #6154
Closed

No build error message very verbose #2519

konstin opened this issue Mar 18, 2024 · 5 comments · Fixed by #6154
Labels
error messages Messaging when something goes wrong

Comments

@konstin
Copy link
Member

konstin commented Mar 18, 2024

The no build error messages are very verbose since they do no collapse versions. Example:

$ echo "pytest-pep8" | cargo run -q pip compile --no-build -
  × No solution found when resolving dependencies:
  ╰─▶ Because only the following versions of pytest-pep8 are available:
          pytest-pep8==0.5
          pytest-pep8==0.6
          pytest-pep8==0.7
          pytest-pep8==0.8
          pytest-pep8==0.9
          pytest-pep8==0.9.1
          pytest-pep8==1.0
          pytest-pep8==1.0.1
          pytest-pep8==1.0.2
          pytest-pep8==1.0.3
          pytest-pep8==1.0.4
          pytest-pep8==1.0.5
          pytest-pep8==1.0.6
      and pytest-pep8==0.5 is unusable because no wheels are usable and building from source is disabled, we can conclude that pytest-pep8<0.6 cannot be used.
      And because pytest-pep8==0.6 is unusable because no wheels are usable and building from source is disabled, we can conclude that pytest-pep8<0.7 cannot be used.
      And because pytest-pep8==0.7 is unusable because no wheels are usable and building from source is disabled and pytest-pep8==0.8 is unusable because no wheels
      are usable and building from source is disabled, we can conclude that pytest-pep8<0.9 cannot be used.
      And because pytest-pep8==0.9 is unusable because no wheels are usable and building from source is disabled and pytest-pep8==0.9.1 is unusable because no wheels
      are usable and building from source is disabled, we can conclude that pytest-pep8<1.0 cannot be used.
      And because pytest-pep8==1.0 is unusable because no wheels are usable and building from source is disabled and pytest-pep8==1.0.1 is unusable because no wheels
      are usable and building from source is disabled, we can conclude that pytest-pep8<1.0.2 cannot be used.
      And because pytest-pep8==1.0.2 is unusable because no wheels are usable and building from source is disabled and pytest-pep8==1.0.3 is unusable because no
      wheels are usable and building from source is disabled, we can conclude that pytest-pep8<1.0.4 cannot be used.
      And because pytest-pep8==1.0.4 is unusable because no wheels are usable and building from source is disabled and pytest-pep8==1.0.5 is unusable because no
      wheels are usable and building from source is disabled, we can conclude that pytest-pep8<1.0.6 cannot be used.
      And because pytest-pep8==1.0.6 is unusable because no wheels are usable and building from source is disabled and you require pytest-pep8, we can conclude that
      the requirements are unsatisfiable.

Different example:

$ echo "superset" | cargo run -q pip compile --no-build -
  × No solution found when resolving dependencies:
  ╰─▶ Because only the following versions of superset are available:
          superset<=0.26.3
          superset>=0.27.0,<=0.28.1
          superset>=0.30.0
      and superset==0.13.2 is unusable because no wheels are usable and building from source is disabled, we can conclude that any of:
          superset<0.14.0
          superset>0.26.3,<0.27.0
          superset>0.28.1,<0.30.0
       cannot be used.
      And because superset==0.14.0 is unusable because no wheels are usable and building from source is disabled and superset==0.14.1 is unusable because no wheels
      are usable and building from source is disabled, we can conclude that any of:
          superset<0.15.0
          superset>0.26.3,<0.27.0
          superset>0.28.1,<0.30.0
       cannot be used.
      And because superset==0.15.0 is unusable because no wheels are usable and building from source is disabled and superset==0.15.1 is unusable because no wheels
      are usable and building from source is disabled, we can conclude that any of:
          superset<0.15.3
          superset>0.26.3,<0.27.0
          superset>0.28.1,<0.30.0
       cannot be used.
[...many more cases]
      And because superset==0.26.2 is unusable because no wheels are usable and building from source is disabled and superset==0.26.3 is unusable because no wheels
      are usable and building from source is disabled, we can conclude that any of:
          superset<0.27.0
          superset>0.28.1,<0.30.0
       cannot be used.
      And because superset==0.27.0 is unusable because no wheels are usable and building from source is disabled and superset==0.28.0 is unusable because no wheels
      are usable and building from source is disabled, we can conclude that any of:
          superset<0.28.1
          superset>0.28.1,<0.30.0
       cannot be used.
      And because superset==0.28.1 is unusable because no wheels are usable and building from source is disabled and superset==0.30.0 is unusable because no wheels
      are usable and building from source is disabled, we can conclude that superset<0.30.1 cannot be used.
      And because superset==0.30.1 is unusable because no wheels are usable and building from source is disabled and you require superset, we can conclude that the
      requirements are unsatisfiable.

      hint: Pre-releases are available for superset in the requested range (e.g., 0.29.0rc7), but pre-releases weren't enabled (try: `--prerelease=allow`)
@konstin konstin added the error messages Messaging when something goes wrong label Mar 18, 2024
@zanieb
Copy link
Member

zanieb commented Mar 18, 2024

I'm not sure why these don't collapse, but I'd love to collapse them.

@Eh2406
Copy link

Eh2406 commented Mar 20, 2024

In the long run, I'd like to see pubgrub-rs/pubgrub#163 but for unavailable constraints. This should probably happen after upstreaming the ability to customize the error message for each constraint. Which in turn is dependent on pubgrub-rs/pubgrub#190

@owenlamont
Copy link

I've just run into a similar issue with how verbose uv pip compile is which was more than just a slight inconvenience since we run it as a docker build step and docker compose truncates the step output at 2 MiB with no work-around (maybe a work-around with buildx but not docker compose build - see docker/buildx#484 and docker/for-mac#6332 for context). I see the output of uv pip compile for a while then just: [output clipped, log limit 2MiB reached]

A dependency error happened after that but I spent hours looking for a Docker limit work-around to no avail and ended up having to hack the constraints to find out what the problem dependency was. I was checking the uv pip compile arguments to see if there's a way to make it less verbose or only show errors but I saw no options, other than --quiet which I didn't try because it sounded like that would remove all output completely and I wasn't sure if that included errors)

@zanieb
Copy link
Member

zanieb commented Mar 24, 2024

@owenlamont this issue is for a specific no solution error message case — it sounds like you're talking about something else. Please open a new issue with more details about the invocation you're using and the output you are seeing.

@konstin
Copy link
Member Author

konstin commented Jun 7, 2024

Found another case with tensorflow and reported it upstream: pubgrub-rs/pubgrub#232

zanieb added a commit that referenced this issue Aug 16, 2024
Uses my expanding tree reduction knowledge from #6092 to improve the
long-standing issue of verbose messages for unavailable packages.

Implements pubgrub-rs/pubgrub#232, but
post-resolution instead of during resolution.

Partially addresses #5046
Closes #2519
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants