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

Error when extra of requirement is missing #386

Closed
konstin opened this issue Nov 10, 2023 · 2 comments · Fixed by #627
Closed

Error when extra of requirement is missing #386

konstin opened this issue Nov 10, 2023 · 2 comments · Fixed by #627
Assignees
Labels
bug Something isn't working

Comments

@konstin
Copy link
Member

konstin commented Nov 10, 2023

I tried to resolve torch[transformers] (it's the other way round) and got a very confusing error:

cargo run --bin puffin-dev -- resolve-cli "torch[tranformers]"
    Finished dev [unoptimized + debuginfo] target(s) in 0.08s
     Running `target/debug/puffin-dev resolve-cli 'torch[tranformers]'`
puffin-dev failed
  Caused by: No solution found when resolving: torch[tranformers]
  Caused by: Because there is no version of torch[tranformers] available matching <1.7.1, >1.7.1, <1.8.0, >1.8.0, <1.8.1, >1.8.1, <1.9.0, >1.9.0, <1.9.1, >1.9.1, <1.10.0, >1.10.0, <1.10.1, >1.10.1, <1.10.2, >1.10.2, <1.11.0, >1.11.0, <1.12.0, >1.12.0, <1.12.1, >1.12.1, <1.13.0, >1.13.0, <1.13.1, >1.13.1, <2.0.0, >2.0.0, <2.0.1, >2.0.1, <2.1.0, >2.1.0 and dependencies of torch[tranformers] at version ==1.7.1 are unavailable, torch[tranformers]<1.8.0, >1.8.0, <1.8.1, >1.8.1, <1.9.0, >1.9.0, <1.9.1, >1.9.1, <1.10.0, >1.10.0, <1.10.1, >1.10.1, <1.10.2, >1.10.2, <1.11.0, >1.11.0, <1.12.0, >1.12.0, <1.12.1, >1.12.1, <1.13.0, >1.13.0, <1.13.1, >1.13.1, <2.0.0, >2.0.0, <2.0.1, >2.0.1, <2.1.0, >2.1.0 is forbidden.
And because dependencies of torch[tranformers] at version ==1.8.0 are unavailable and dependencies of torch[tranformers] at version ==1.8.1 are unavailable, torch[tranformers]<1.9.0, >1.9.0, <1.9.1, >1.9.1, <1.10.0, >1.10.0, <1.10.1, >1.10.1, <1.10.2, >1.10.2, <1.11.0, >1.11.0, <1.12.0, >1.12.0, <1.12.1, >1.12.1, <1.13.0, >1.13.0, <1.13.1, >1.13.1, <2.0.0, >2.0.0, <2.0.1, >2.0.1, <2.1.0, >2.1.0 is forbidden.
And because dependencies of torch[tranformers] at version ==1.9.0 are unavailable and dependencies of torch[tranformers] at version ==1.9.1 are unavailable, torch[tranformers]<1.10.0, >1.10.0, <1.10.1, >1.10.1, <1.10.2, >1.10.2, <1.11.0, >1.11.0, <1.12.0, >1.12.0, <1.12.1, >1.12.1, <1.13.0, >1.13.0, <1.13.1, >1.13.1, <2.0.0, >2.0.0, <2.0.1, >2.0.1, <2.1.0, >2.1.0 is forbidden.
And because dependencies of torch[tranformers] at version ==1.10.0 are unavailable and dependencies of torch[tranformers] at version ==1.10.1 are unavailable, torch[tranformers]<1.10.2, >1.10.2, <1.11.0, >1.11.0, <1.12.0, >1.12.0, <1.12.1, >1.12.1, <1.13.0, >1.13.0, <1.13.1, >1.13.1, <2.0.0, >2.0.0, <2.0.1, >2.0.1, <2.1.0, >2.1.0 is forbidden.
And because dependencies of torch[tranformers] at version ==1.10.2 are unavailable and dependencies of torch[tranformers] at version ==1.11.0 are unavailable, torch[tranformers]<1.12.0, >1.12.0, <1.12.1, >1.12.1, <1.13.0, >1.13.0, <1.13.1, >1.13.1, <2.0.0, >2.0.0, <2.0.1, >2.0.1, <2.1.0, >2.1.0 is forbidden.
And because dependencies of torch[tranformers] at version ==1.12.0 are unavailable and dependencies of torch[tranformers] at version ==1.12.1 are unavailable, torch[tranformers]<1.13.0, >1.13.0, <1.13.1, >1.13.1, <2.0.0, >2.0.0, <2.0.1, >2.0.1, <2.1.0, >2.1.0 is forbidden.
And because dependencies of torch[tranformers] at version ==1.13.0 are unavailable and dependencies of torch[tranformers] at version ==1.13.1 are unavailable, torch[tranformers]<2.0.0, >2.0.0, <2.0.1, >2.0.1, <2.1.0, >2.1.0 is forbidden.
And because dependencies of torch[tranformers] at version ==2.0.0 are unavailable and dependencies of torch[tranformers] at version ==2.0.1 are unavailable, torch[tranformers]<2.1.0, >2.1.0 is forbidden.
And because dependencies of torch[tranformers] at version ==2.1.0 are unavailable and root ==0a0.dev0 depends on torch[tranformers], version solving failed.

Compared to pip-compile:

echo "torch[transformers]" | pip-compile --output-file - -
  WARNING: torch 2.1.0 does not provide the extra 'transformers'
[...]
@charliermarsh
Copy link
Member

We should add a test for this.

@charliermarsh charliermarsh added the bug Something isn't working label Nov 13, 2023
@charliermarsh charliermarsh added this to the Feature complete milestone Nov 13, 2023
@charliermarsh
Copy link
Member

@zanieb - This is another concrete example where it'd be nice to have a custom error message on failure.

@charliermarsh charliermarsh self-assigned this Dec 12, 2023
charliermarsh added a commit that referenced this issue Dec 13, 2023
## Summary

When resolving `transformers[tensorboard]`, the `[tensorboard]` extra
doesn't exist. Previously, we returned "unknown" dependencies for this
variant, which leads the resolution to try all versions, then fail. This
PR instead warns, but returns the base dependencies for the package,
which matches `pip`. (Poetry doesn't even warn, it just proceeds as
normal.)

Arguably, it would be better to return a custom incompatibility here and
then propagate... But this PR is better than the status quo, and I don't
know if we have support for that behavior yet...? (\cc @zanieb)

Closes #386.

Closes #423.
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

Successfully merging a pull request may close this issue.

2 participants