-
Notifications
You must be signed in to change notification settings - Fork 0
pip provenance PEP #2
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
Conversation
a7c1bd6 to
0cd4065
Compare
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
|
A PoC patch for pip to bring this functionality in fridex/pip#1 |
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
a7ab14b to
ec71fac
Compare
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Co-authored-by: Brett Cannon <brett@python.org>
pep-9999.rst
Outdated
| ``hashlib.algorithms_guaranteed`` SHOULD always be included. At the time of | ||
| writing, ``sha256`` specifically is recommended. | ||
|
|
||
| - A ``hash`` key (type ``string``) MAY be present for compatibility purposes |
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.
what compatibility purposes? List why those are important in the context of this file? What existing code is expected to be processing these that will not look at archive_info.hashes? Link to it and explain why expecting up to date versions of that to exist for parsing these cannot be achieved.
ie, if pip is the reason, explain how an old version of pip not supporting this file would ever be run in the presence of an installation with these files put in place by an installer and how it would ever wind up reading them.
I personally think a new PEP and data file is an opportunity to not allow/support the legacy in this new file.
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.
I personally think a new PEP and data file is an opportunity to not allow/support the legacy in this new file.
The PEP tried to respect what is already implemented in pip - not to introduce large changes that would eventually be harder to get accepted. If the PEP could throw away what is legacy here, as you suggest in your comments, that would be great.
I'll try to incorporate your suggestions, they look very reasonable. Thank you.
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.
what compatibility purposes? List why those are important in the context of this file? What existing code is expected to be processing these that will not look at archive_info.hashes? Link to it and explain why expecting up to date versions of that to exist for parsing these cannot be achieved.
ie, if
pipis the reason, explain how an old version ofpipnot supporting this file would ever be run in the presence of an installation with these files put in place by an installer and how it would ever wind up reading them.I personally think a new PEP and data file is an opportunity to not allow/support the legacy in this new file.
Thinking about this, I'm not sure whether this should go into this PEP. As the PoC reused DirectUrl to understand what is needed to change in sources, the actual implementation might introduce a new class or at least adjust the current one to better respect provenance_url.json and its proposed implementation in this PEP, not to create confusion with direct_url.json (also, its internal pip API).
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.
Since the hash key is deprecated in direct_url.json, I don't think it's worth keeping here (which it looks like the latest draft removed!).
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.
Thanks to gpshead for this suggestion. Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Thanks to gpshead for these suggestions. Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
|
@fridex you can now simplify the specification part by referencing https://packaging.python.org/en/latest/specifications/direct-url-data-structure/. |
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Thanks, added to the references section for now - not sure if it should be directly used in the specification section as EDIT: The |
|
@fridex thanks for the update. I personally think it is better to reference the direct url data structure in the specification section, mentioning that only By reusing the same specification, implementers can safely assume they can reuse the same code without having to dissect and compare the specs. It will also simplify maintenance if/when the spec evolves. The |
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Thanks, this seems reasonable as it follows what is already implemented in pip and is closer to the proposed pip PR and PEP-610. On the other hand, the proposed PEP is shifting away from this based on these two discussions with @gpshead: Old text in this draft PEP, taken from PEP-610:
Which resulted in a change to this wording:
Old text in this draft PEP, taken from PEP-610:
This led to a complete removal of the It looks like we will need to make a consensus here. BTW we should move this discussion to discuss.python.org as requested by Paul. It seems like it will make it easier for Paul to review it and also include other folks. I try to keep the draft PEP text up to date there. |
@fridex I already raised this point at https://discuss.python.org/t/draft-pep-recording-provenance-of-installed-packages/24838/15?u=sbidoul I don't think there is any incompatibility with what @gpshead said, though:
|
This section now states Conda installer and other downstream installers. Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Let's have a sync once the PEP is actually submitted. I kept the @sbidoul thanks again for your very valuable feedback! |
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
Signed-off-by: Fridolin Pokorny <fridolin.pokorny@datadoghq.com>
|
Replaced with python#3076 |
Replaced with python#3076