3 ms·
PEP 751 "A file format to record Python dependencies for installation reproducibility" (https://peps.python.org/pep-0751/ https://peps.python.org/pep-0751/) is
by zahlman 2y ago
PEP 751 "A file format to record Python dependencies for installation reproducibility" (https://peps.python.org/pep-0751/ https://peps.python.org/pep-0751/) is essentially a proposed ecosystem-wide standard format for lock files for Python projects.
While I'm still not convinced that most people really need all the features of a general purpose lock file for their individual use cases, it does make sense to have a format which includes (or can include "everything". Conceptually this creates a logical, semantic separation between abstract immediate dependencies (in a `pyproject.toml` file) and resolved, concrete, transitive dependencies in the lock file.
For example, an installer could recognize that it's been given the latter, and skip the steps to re-compute a package resolution that won't change anything. (Although that doesn't help much for updating an existing environment - since you have to check for conflicts with the existing packages, and decide what to do if you find one.) Build backends (when the package is for an "application") could verify that the `pyproject.toml` abstract dependencies are solved by the lock, and then list the concrete dependencies in core metadata (PKG-INFO for an sdist or METADATA for a wheel) instead of leaving the abstract ones alone. But there's an issue here: an installer wouldn't know that these dependencies have already been resolved, because the distinction between `pyproject.toml` and `pylock.toml` has been lost. It seems like `pylock.toml` is intended as a development tool, not as alternate metadata that would be included in a wheel. Although installers that have a separate concept of "installing applications" could presumably be directed to look at `pylock.toml` if it were included in a wheel - for a directly specified single package, not for its dependencies.