8000 PEP 751: A file format to list Python dependencies for installation reproducibility by brettcannon · Pull Request #3870 · python/peps · GitHub
[go: up one dir, main page]

Skip to content

PEP 751: A file format to list Python dependencies for installation reproducibility #3870

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

Merged
merged 59 commits into from
Jul 24, 2024
Merged
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
5e9e274
Write up to the specification
brettcannon Mar 20, 2024
f4fc728
Tweak rationale
brettcannon Mar 21, 2024
68a6dcd
Write down the file format
brettcannon Mar 21, 2024
761922e
Add in the `[[tool]]` table array
brettcannon Mar 21, 2024
61a72f5
Add expectations for lockers
brettcannon Mar 21, 2024
86e44fa
Add expectations for installers for per-file locking
brettcannon Mar 21, 2024
a960f76
Add some clarifications
brettcannon Mar 21, 2024
08f59d3
Example workflow for package locking
brettcannon Mar 22, 2024
82393b2
Bit of a clarification
brettcannon Mar 22, 2024
8c6801d
Add `package.tool`
brettcannon Mar 23, 2024
6b188ba
Add `package.dependents`
brettcannon Mar 23, 2024
6cced99
Fix a typo
brettcannon Mar 23, 2024
0080fc2
Add `package.description`
brettcannon Mar 23, 2024
1214a78
Add `package.direct`, `package.directory`, and `package.multiple-entr…
brettcannon Mar 25, 2024
92de818
Rename `package.simple-repo-package-url` and add `package.files.simpl…
brettcannon Mar 26, 2024
619bd6e
Updates based on some review comments
brettcannon Mar 28, 2024
244957c
Use a fake PEP number to make CI happy
brettcannon Mar 28, 2024
6a92b8f
Add an explicit note that the directory to write a `pylock.toml` file…
brettcannon Mar 28, 2024
2eb7166
Make the hash algorithm its own setting
brettcannon Mar 29, 2024
3623ccf
Fill out the ACKS section
brettcannon Mar 29, 2024
22fc531
Outline rejected ideas
brettcannon Mar 29, 2024
3182912
Add a rejected idea
brettcannon Mar 30, 2024
0e1df0c
Record the rejected idea of new core metadata version for metadata co…
brettcannon May 24, 2024
48811ee
Answer the rejected idea of having the installer do resolution
brettcannon May 25, 2024
b1c2fdc
Fill in rejected ideas around file names
brettcannon May 25, 2024
135a13e
Add rejected ideas around the file format
brettcannon May 27, 2024
450a50f
Finish filling in the rejected ideas
brettcannon May 27, 2024
aa7840f
Minor tweaks
brettcannon May 31, 2024
f6b02ef
Finish proofreading
brettcannon Jun 7, 2024
b35057a
Clarify that installers should never guess which `[[file-lock]]` to i…
brettcannon Jul 11, 2024
c16848b
reST fix
brettcannon Jul 11, 2024
15b2c05
Fix reST links
brettcannon Jul 11, 2024
040fa85
Add a TOML link target
brettcannon Jul 11, 2024
902ab69
Clarify that the file format is designed to facilitate diff reading
brettcannon Jul 23, 2024
c2677c1
Merge branch 'main' of github.com:python/peps into lock-file
brettcannon Jul 24, 2024
e1ec016
Refer to PoCs
brettcannon Jul 24, 2024
08e6fdb
Tweak some wording
brettcannon Jul 24, 2024
a3a1485
Pick a PEP number
brettcannon Jul 24, 2024
462b7e0
Update CODEOWNERS
brettcannon Jul 24, 2024
53a0ba6
Merge branch 'main' into lock-file
brettcannon Jul 24, 2024
75d6615
Clean up CODEOWNERS
brettcannon Jul 24, 2024
beaee5c
Merge branch 'lock-file' of https://github.com/brettcannon/peps into …
brettcannon Jul 24, 2024
dec8120
Fix lint failures
brettcannon Jul 24, 2024
a4d1840
Fix another lint failure
brettcannon Jul 24, 2024
b0d4877
Nest sections more
brettcannon Jul 24, 2024
1b39e49
Accept/address some comments
brettcannon Jul 24, 2024
9031e5c
Apply suggestions from code review
brettcannon Jul 24, 2024
fd139c3
Apply suggestions from code review
brettcannon Jul 24, 2024
89ff321
Apply suggestions from code review
brettcannon Jul 24, 2024
a914c12
Apply suggestions from code review
brettcannon Jul 24, 2024
8c21909
Adam likes periods
brettcannon Jul 24, 2024
98b4e82
More details around hashing
brettcannon Jul 24, 2024
e27b73d
Clarify `package.direct` defaults to `false`
brettcannon Jul 24, 2024
c0d46a1
Specify ``[[package.files]]` should be sorted by name
brettcannon Jul 24, 2024
0c45e87
Clarify that `[[package.build-requires]]` is locked
brettcannon Jul 24, 2024
ce18c5c
Clean up a sentence
brettcannon Jul 24, 2024
f5b574e
Fix a section title
brettcannon Jul 24, 2024
17ce7cd
Tweak abstract
brettcannon Jul 24, 2024
6df00c5
Merge branch 'main' into lock-file
brettcannon Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 24, 2024
commit a914c12ed81473316a3124745d3e66ea74223203
20 changes: 10 additions & 10 deletions peps/pep-0751.rst
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@ An example workflow is:
"best" file to install
- If no file is found, check for ``[package.vcs]``
- If no match is found, an error MUST be raised
- Find and verify the selected files and/or CVS entries based on their hash or
- Find and verify the selected files and/or VCS entries based on their hash or
commit ID as appropriate
- If the match is a source distribution or VCS and
``[[package.build-requires]]`` is provided, repeat the above as appropriate to
Expand Down Expand Up @@ -670,7 +670,7 @@ within the file in a ``[tool]`` entry or via a side channel external to the lock
file itself.

This PEP does not do anything to prevent a user from installing an incorrect
package. While including many details to help in audting a package's inclusion,
package. While including many details to help in auditing a package's inclusion,
there isn't any mechanism to stop e.g. name confusion attacks via typosquatting.
Lockers may be able to provide some UX to help with this (e.g. by providing
download counts for a package).
Expand All @@ -683,13 +683,13 @@ How to Teach This
Users should be informed that when they ask to install some package, that
package may have its own dependencies, those dependencies may have dependencies,
and so on. Without writing down what gets installed as part of installing the
package they requested, things could change from underneatch them (e.g. package
package they requested, things could change from underneath them (e.g. package
versions). Changes to the underlying dependencies can lead to accidental
breakage of their code. Lock files help deal with that by providing a way to
write down what was installed.

Having what to install written down also helps in collabortaing with others. By
agreeing to a lock file's contents, everyone to end up with the same packages
Having what to install written down also helps in collaborating with others. By
agreeing to a lock file's contents, everyone ends up with the same packages
installed. This helps make sure no one relies on e.g. an API that's only
available in a certain version that not everyone working on the project has
installed.
Expand All @@ -705,15 +705,15 @@ Reference Implementation
========================

A rough proof-of-concept for per-file locking can be found at
https://github.com/brettcannon/mousebender/tree/pep . An example lock file can
https://github.com/brettcannon/mousebender/tree/pep. An example lock file can
be seen at
https://github.com/brettcannon/mousebender/blob/pep/pylock.example.toml .
https://github.com/brettcannon/mousebender/blob/pep/pylock.example.toml.

For per-package locking, PDM_ indirectly proves the approach works as this PEP
maintains equivalent data as PDM does for its lock files (whose format was
inspired by Poetry_). Some of the details of PDM's approach are covered in
https://frostming.com/en/2024/pdm-lockfile/ and
https://frostming.com/en/2024/pdm-lock-strategy/ .
https://frostming.com/en/2024/pdm-lock-strategy/.


==============
Expand Down Expand Up @@ -771,7 +771,7 @@ Requiring specific hash algorithm support
It was proposed to require a baseline hash algorithm for the files. This was
rejected as no other Python packaging specification requires specific hash
algorithm support. As well, the minimum hash algorithm suggested may eventually
become an outdated/unsafe suggetion, requiring further updates. In order to
become an outdated/unsafe suggestion, requiring further updates. In order to
promote using the best algorithm at all times, no baseline is provided to avoid
simply defaulting to the baseline in tools without considering the security
ramifications of that hash algorithm.
Expand Down Expand Up @@ -802,7 +802,7 @@ knowledge about the file extension.
Not having a naming convention for the file
===========================================

Having not requirements or guidance for a lock file's name was considered, but
Having no requirements or guidance for a lock file's name was considered, but
ultimately rejected. By having a standardized naming convention it makes it easy
to identify a lock file for both a human and a code editor. This helps
facilitate discovery when e.g. a tool wants to know all of the lock files that
Expand Down
0