Support selective ignoring of package dependencies #1645
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.
Greetings, and thanks for this great library.
This is another PR addressing the "exclude-type" operations discussed in #333, and it is complementary to #1509.
#1509 lets you say: "After resolving the whole dependency graph, delete these nodes out of it."
This PR lets you say two different things:
"I want package
A
without requiring any of its dependencies." (cf. pip's--no-deps
)"The authors of package
A
made it depend onB
andC
. But when I useA
I don't needC
. So treatA
as if it didn't depend onC
."Usage looks like:
or
respectively.
Critically, we are not deleting nodes from the dependency graph, we are deleting edges, and refusing to follow them.
This means we are happy for some other package to bring a node into the graph, should that ever happen. So with this graph,
as long as I depend only on
A
, I wantpip-compile --cut-deps A:C
to keepC
,F
,G
out of my installation.However, if some day I add
X
to my project, then I'm happy forC
,F
,G
to come in.Contributor checklist
Maintainer checklist
backwards incompatible
,feature
,enhancement
,deprecation
,bug
,dependency
,docs
orskip-changelog
as they determine changelog listing.