I’m reading though all of the discussion here, and I’m a little confused (or maybe taken aback?) by some of the points being raised here.
One of the things that is sticking out to me here is that there seems to be a general concern that package authors, when handed some new tool, are going to start acting with disregard towards their users. I don’t think that’s a super helpful way to think about that set of users that we are trying to serve. Certainly we should think about how likely it is that someone may misuse a given feature, and if they do what the ramifications of that would be.
Unfortunately the way I’ve read a lot of the discussion here, is coming across to me, as suggesting that if this feature could be misused, then it is a bad feature, and I think that is an unhelpful framing. Every feature you could ever possibly add could be misused somehow, so that argument, taken to it’s logical conclusion, is that we should have no features at all
.
It seems like one of the big sticking points is this idea of "redefining what pip install some-project means, with the idea behind that currently some-project means the minimal set of dependencies.
I’ve been thinking about that a little bit, and it stands out to me the idea that some-project means “the minimal set of dependencies” is technically true when you think about the standards in the abstract, but it’s not actually true in practical reality.
In practical reality some-project means “the set of dependencies that the package author thought you should get by default”. Sometimes that’s the minimal set of dependencies, if the author only listed the minimal set of dependencies as required dependencies, but sometimes it’s not the minimal set of dependencies if the author listed “stuff that most people would want but aren’t strictly required”.
After all, there’s nothing that requires the non-optional dependencies to actually be non-optional, or to even be used at all. We’ve just given authors the ability to list dependencies to install by default, and assumed they’re going to make reasonable use of that feature for their users.
With this framing in mind , I would argue that PEP 771 doesn’t actually break backwards compatibility in a practical sense. pip install foo is still going to install "the set of dependencies that the package author thought you should get by default, but now we’ve given authors an extra tool to allow them to more accurately specify their true minimal set of dependencies-- and for users to explicitly request that.
That actually feels like a strictly better outcome for people who are worried about trying to resolve a minimal set of dependencies in their environment. Both with and without PEP 771 there’s no guarantee you’d actually getting the minimal set of dependencies , but with PEP 771 there’s a stronger likelihood that projects that feel their users are best served by having more than the strict minimum set installed installed by default, will actually accurately specify what their minimum set of dependencies are.
I understand the concern that some people may feel empowered to add default extras that pull in more dependencies than expected under the guise of “well they can always turn it off”-- but I think that concern is honestly overblown. I suspect that the set of package authors who feel that some dependency should be installed by default, but are resisting that urge because of pedantic adherence to the intent of required dependencies is likely quite small.
As far as making this opt in, I personally think that isn’t really a worthwhile change. We already have an opt-in way to add extra dependencies, it’s called extras
, and that serves reasonably well for the use case of adding optional dependencies that a package author doesn’t think should be installed by default.
What we’re lacking is a mechanism for optional dependencies that a package author does think should be installed by default, and we’ve got clear evidence that because we’re lacking that mechanism, a non zero number of reputable and important packages are over specifying their “required” dependencies, to work around it.
But to go back to my first thing, I think we should, in general, assume that package authors are going to do what they think is best for their users and not assume they’re going to act with disregard towards them.