This is why supporting sdists and source tree is a separate concern that may end up with their own PEP (as well as why the file format is versioned); as of right now thereâs not reason to layer on extra things to tell something is a wheel. We donât need to prematurely optimize for something that isnât in the PEP yet and for which adding support for in the future will definitely require additional support by all tools involved.
Organizational. If your lock file pulls in 2 or 3 different versions of a package to meet various platform requirements, do you want to have to scan the body of array entry to see which version it is, or would you rather have it clear by the section? Or put another way, semantically various files for the same version are related, but files from different versions have no relation to each other beyond the fact that the same project released them. Grouping by release is (at least) how I view things on PyPI and as a whole and what you typically lock by, not as an overall project.
Well, thatâs enough co-authors to accept that as the solution.
Because there are a bunch of fields that PEP 621 mandates due to core metadata that an app simply doesnât need to care about (e.g. you donât really need to give your app a name).
Itâs up to the locker to decide what to put into metadata.requires. This is on purpose so the resulting dependency graph can be whatever it needs to be to resolve appropriately.
IMO this needs an entire PEP to discuss. It is not unreasonable to reuse project.dependencies as inputs, but there are still a bunch of unanswered questions. The input, for example, must allow the user to specify an alternative index to fetch packages (and allow index fallback etc.), and once you do that youâll also need to discuss how the format can be successfully taught with minimal confusion regarding how the index specification is only effective if you use pyproject.toml directly, not when you package it into a distribution (i.e. you canât specify indexes, put the package to PyPI, and expect pip to fetch the packageâs dependencies from your own index instead of PyPI). This is even arguably enough rationale against reusing project.dependencies as input to the lock file.
I figured this is where this is going to end up, but I figured I would at least ask to see if there was a chance people actually agreed on this.
Interesting difference in opinion as my brain always thinks of that as something to specify on the command-line rather than in the configuration file. But I do know that requirements files support this, so maybe its usefulness is broader than I realize/think.
OK, I will remove this as an open issue, leaving us just with the sdist discussion to resolve before the PEP is ready for pronouncement!
Thereâs a partial PEP in progress somewhere to define a shareable format for this kind of configuration.
I donât think this necessarily has to be locked, though itâs definitely convenient to have the source listed provided installers allow it to be overridden (e.g. I should be able to use an internal PyPI mirror/cache rather than being forced to go via the internet).
I just added the following to try and make it as clear as possible that the PEP is flexible around anything it doesnât specify on purpose:
As Flexible as Possible
Realizing that workflows vary greatly between companies, projects, and
even people, this PEP tries to be strict where itâs important and
undefined/flexible everywhere else. As such, this PEP is strict where
it is important for reproducibility and compatibilitiy, but does not
specify any restrictions in other situations not covered by this PEP;
if the PEP does not specifically state something then it is assumed to
be up to the locker or installer to decide what is best.
Note that I specifically said âinputâ without specifying where the input should come from
The input can come from the lock file used for installation, but it can also come from additional user inputs (e.g. command line options, configuration files, or environment variables) specified to the locker and installer, or even only available in the original application manifest without the information being locked.
Also note that what indexes were used to generate the lock file is inheritantly not meaningful knowledge to the installer, since the lock file already provides enough information for the installer to find exact artifacts without index knowledge. So the installer only needs to allow two use cases:
No index override, where the installer simply uses the artifact URLs provided by the lock file.
An explicit index override, where the installer ignores all the artifact URLs and find artifacts based on versions, filenames, hashes etc. instead.
While I understand the motivation here, how do we avoid lockers depending on a particular installer? (Past experience leads me to believe that people will expect anything install-related to be handled by pip, so âwhat pip doesâ could end up being a de facto standard for anything not covered by the PEP).
Itâs possible this wonât be an issue in practice - do you have an example of something where the PEP deliberately doesnât restrict something in the way you describe?
No, but some offline feedback I got was that some of the worries about not supporting sdists may be coming from people feeling that if it isnât in the PEP that it canât be solved outside of it.
OK, but sdist support is covered by the PEP, at least to the extent that it is currently an open issue and presumably at some point will be moved to ârejected ideasâ. So there will certainly have to be some information in the PEP, even if the implementation details remain open.
Iâd expect that when sdists are moved to the ârejected ideasâ section (assuming thatâs what happens), the following points would be made:
The PEP clarifies that while there are use cases for sdist support, those are considered out of scope for PEP 665.
Itâs explicitly noted that adding sdist support via a follow-up PEP was discussed and is how this PEP expects sdist support to be added at a future date, if required.
Iâd imagine a key reason for the rejection would be because itâs much harder to achieve reproducibility for sdists - so the rejection should note this and clarify that any future sdist support PEP needs to describe how reproducibility will be handled.
I donât know whether that matches peopleâs expectations about âsolving sdist support outside of PEP 665â. In particular, though, if people want to experiment with implementing such support, they will need to write their own lockfile installer - pip isnât the place for such experimentation.
To be explicit, pip will need sdist support to be backed by an approved PEP before we add it.
Iâd also like to see (assuming sdist support gets rejected) an explicit paragraph in the motivation section explaining that the PEP chooses to only support wheels because that allows reproducibility to be guaranteed without needing build systems to provide reproducibility guarantees as well (which, as far as I know, none of them formally do). I think that would make the current emphasis in the PEP on reproducibility less distracting for people who donât have a strong need for it.
Sure, but the rest of the PEP is written as if sdists are not supported.
Yes.
Assuming Supporting sdists and source trees in PEP 665 doesnât lead to sdists making into this PEP, I would summarize whatâs there which includes what needs to be resolved by any future PEP.
So now that the PEP no longer supports sdists, can we do a review of whether it still covers enough use cases to be viable? In my experience, I donât think Iâve ever heard anyone ask for pip to support reproducible installs explicitly, so while I get that the idea is that PEP 665 is about ensuring reproducible installs, what evidence do we have that enough people actually want reproducible installs to make it worth having a standardised lockfile whose main (sole?) purpose is to provide them?
In particular, thereâs already a conversation starting about a follow-up proposal for adding sdist support. Iâm not particularly happy about the possibility that PEP 665 canât stand on its own merits and is merely a starting point for adding sdists. We have enough PEPs that have been approved but no-one is working on implementing them, that I donât want to add another one to that listâŠ
I know of enterprise users who solve this problem by having a PyPI mirror because pip isnât secure by default in terms of what it installs. They canât trust users to use any other index but their own private one that only contains code that has been cleared for use (i.e. tightly control what dependencies may get pulled in).
I know @kushaldas greatly cares about reproducible installs for SecureDrop.
Sorry, I explained badly. I wasnât asking about reproducibility in its own right, I was asking about whether there was still sufficient demand for PEP 665, in its new form.
The original justification for PEP 665 was that âpeople want lockfilesâ - this is pretty obvious, we have projects like pip-tools, poetry, pipenv, etc, all providing some form of lockfile functionality, so thereâs clearly a need.
The complexities of supporting sdists in line with the goal of reproducibility meant that the PEP dropped the idea of supporting them, and focused solely on wheels. Thatâs fine, but it means that many of the users who weâd previously assumed would benefit from PEP 665 will no longer be able to use it. What proportion? I donât know, and thatâs essentially what Iâm asking.
We canât assume that people using a PyPI mirror will be able to use the new PEP, as they will be mirroring sdists as well, and may well need to install them. That applies to any cases of people concerned about supply chain attacks - itâs possible to mitigate the risk while still using sdists, and itâs entirely possible that solutions which block sdists wonât be acceptable in all cases.
OK, letâs put the question to an informal poll:
PEP 665 without wheel support is sufficient for my use cases
I wonât be able to use PEP 665 until sdist support is added
I will use PEP 665 without sdists, but I will need to handle sdists manually for my workflow
I donât need PEP 665, I use existing solutions and am happy with them
Lock files donât matter to me, and/or I have no opinion
0voters
One major problem with relying on votes is that âpeople following the PEP discussionâ isnât a particularly representative group. If someone wants to reach out to the wider community for feedback, that would be helpful here.
I just noticed, I inadvertently worded the âPEP 665 is sufficientâ option as âPEP 665 without wheel support is sufficient for my use casesâ Aargh - and I canât edit the poll now
I hope it was obvious to everyone that I meant âPEP 665 with wheel support is sufficient for my use casesâ. If anyone wants to change their vote, please comment. Or if people think this is sufficient of a mistake that I should restart the poll, then Iâm happy to do that too.