-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Use UnusableDependencies
for URL dependency conflicts
#425
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It'd be nice to add a backtracking test case. |
...n-cli/tests/snapshots/pip_compile__conflicting_repeated_url_dependency_version_mismatch.snap
Outdated
Show resolved
Hide resolved
charliermarsh
approved these changes
Nov 16, 2023
zanieb
added a commit
that referenced
this pull request
Nov 16, 2023
…cting versions (#424) Addresses #309 (comment) Similar to #338 this throws an error when merging versions results in an empty set. Instead of propagating that error, we capture it and return a new dependency type of `Unusable`. Unusable dependencies are a new incompatibility kind which includes an arbitrary "reason" string that we present to the user. Adding a new incompatibility kind requires changes to the vendored pubgrub crate. We could use this same incompatibility kind for conflicting urls as in #284 which should allow the solver to backtrack to another valid version instead of failing (see #425). Unlike #383 this does not require changes to PubGrub's package mapping model. I think in the long run we'll want PubGrub to accept multiple versions per package to solve this specific issue, but we're interested in it being merged upstream first. This pull request is just using the issue as a simple case to explore adding a new incompatibility type. We may or may not be able convince them to add this new incompatibility type upstream. As discussed in pubgrub-rs/pubgrub#152, we may want a more general incompatibility kind instead which can be used for arbitrary problems. An upstream pull request has been opened for discussion at pubgrub-rs/pubgrub#153. Related to: - pubgrub-rs/pubgrub#152 - #338 - #383 --------- Co-authored-by: konsti <[email protected]>
zanieb
force-pushed
the
zanie/new-incompat-urls
branch
from
November 16, 2023 20:04
04f2f26
to
a3cbc11
Compare
zanieb
commented
Nov 16, 2023
@@ -47,6 +47,16 @@ pub(crate) async fn pip_compile( | |||
cache: &Path, | |||
mut printer: Printer, | |||
) -> Result<ExitStatus> { | |||
miette::set_hook(Box::new(|_| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to consider using this elsewhere, but let's start small
charliermarsh
approved these changes
Nov 16, 2023
zanieb
force-pushed
the
zanie/new-incompat-urls
branch
from
November 16, 2023 21:17
d8d98bc
to
709191e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extends #424 with support for URL dependency incompatibilities.
Requires changes to
miette
to prevent URLs from being word wrapped; accepted upstream in zkat/miette#321