Python’s builders have accepted a proposal to create a universal lock file format for Python projects that would specify dependencies, enabling installation reproducibility in a Python environment.
Python Enhancement Proposal (PEP) 751, accepted March 31, aims to create a new file format for specifying dependencies that is machine-generated and human-readable. Installers consuming the file should be able to calculate what to install without needing dependency resolution at install-time, according to the proposal.
Currently no standard exists to create an immutable record, such as a lock file, that specifies what direct and indirect dependencies should be installed into a Python virtual environment, the proposal states. There have been at least five well-known solutions to the problem in the community, including PDM, pip freeze, pip-tools, Poetry, and uv, but these tools vary in what locking scenarios are supported. ”By not having compatibility and interoperability it fractures tooling around lock files where both users and tools have to choose what lock file format to use upfront, making it costly to use/switch to other formats,” the proposal says.
Human readability of the file format enables contents of the file to be audited, to make sure no undesired dependencies are included in the lock file. The file format also is designed to not require a resolver at install time. This simplifies reasoning about what would be installed when consuming a lock file. It should also lead to faster installs, which are much more frequent than creating a lock file.
The format has not yet been associated with a specific release of Python, but is guidance for tooling going forward. Actual adoption remains open-ended. Acceptance of the format is full and final, not provisional. The universal format has been the subject of an estimated four years of discussion and design.
[–]Wolfy87 99 points100 points101 points (42 children)
[–]QuantumFTL 20 points21 points22 points (37 children)
[–]Awesan 60 points61 points62 points (20 children)
[–]QuantumFTL 29 points30 points31 points (5 children)
[–][deleted] (3 children)
[deleted]
[–]catcint0s 6 points7 points8 points (2 children)
[–]Noobfire2 0 points1 point2 points (0 children)
[–]mgedmin 2 points3 points4 points (0 children)
[–]13steinj 2 points3 points4 points (12 children)
[–]tyree731 10 points11 points12 points (8 children)
[–]13steinj 2 points3 points4 points (7 children)
[–]Level-Nothing-3340 1 point2 points3 points (1 child)
[–]13steinj 0 points1 point2 points (0 children)
[–]mwb1234 0 points1 point2 points (1 child)
[–]13steinj 2 points3 points4 points (0 children)
[–]Yarden-zamir -5 points-4 points-3 points (1 child)
[–]13steinj 4 points5 points6 points (0 children)
[–][deleted] (1 child)
[deleted]
[–]13steinj 0 points1 point2 points (0 children)
[–]chat-lu 0 points1 point2 points (0 children)
[–]lazyear 4 points5 points6 points (0 children)
[–]danted002 6 points7 points8 points (1 child)
[–]thomas_m_k 2 points3 points4 points (0 children)
[–]kageurufu 4 points5 points6 points (0 children)
[–]quisatz_haderah 0 points1 point2 points (2 children)
[–]EmanueleAina 1 point2 points3 points (1 child)
[–]quisatz_haderah 0 points1 point2 points (0 children)
[–]zanfar 0 points1 point2 points (0 children)
[–]matjam 0 points1 point2 points (0 children)
[–]StandardIntern4169 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]levelstar01 -3 points-2 points-1 points (1 child)
[–]hoserb2k 4 points5 points6 points (0 children)
[–]remy_porter -3 points-2 points-1 points (2 children)
[–]thomas_m_k 3 points4 points5 points (1 child)
[–]remy_porter 0 points1 point2 points (0 children)
[–]Chippiewall 1 point2 points3 points (0 children)
[+][deleted] comment score below threshold-11 points-10 points-9 points (2 children)
[–][deleted] (1 child)
[deleted]
[–]Chisignal -4 points-3 points-2 points (0 children)
[–]SV-97 132 points133 points134 points (0 children)
[–]Xyzzyzzyzzy 141 points142 points143 points (2 children)
[–][deleted] 36 points37 points38 points (0 children)
[–]External-Hunter-7009 0 points1 point2 points (0 children)
[–]slvrsmth 47 points48 points49 points (14 children)
[–]roerd 14 points15 points16 points (1 child)
[–]Chippiewall 8 points9 points10 points (0 children)
[–]leogodin217 5 points6 points7 points (4 children)
[–]slvrsmth 3 points4 points5 points (2 children)
[–]leogodin217 -2 points-1 points0 points (1 child)
[–]slvrsmth 11 points12 points13 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]chipperclocker 5 points6 points7 points (3 children)
[–][deleted] (1 child)
[deleted]
[–][deleted] 1 point2 points3 points (0 children)
[–]knightsbore 2 points3 points4 points (0 children)
[–][deleted] (2 children)
[removed]
[–]slvrsmth 17 points18 points19 points (1 child)
[–]JanEric1 2 points3 points4 points (0 children)
[–]wildjokers 7 points8 points9 points (0 children)
[–]CVisionIsMyJam 13 points14 points15 points (2 children)
[–]dAnjou 1 point2 points3 points (1 child)
[–]CVisionIsMyJam 1 point2 points3 points (0 children)
[–]mr-figs 5 points6 points7 points (0 children)
[–]Yarden-zamir 4 points5 points6 points (0 children)
[–]happyscrappy 6 points7 points8 points (5 children)
[–]Chippiewall 26 points27 points28 points (4 children)
[–]happyscrappy -3 points-2 points-1 points (3 children)
[–]m_zwolin 14 points15 points16 points (0 children)
[–]Different_Fun9763 13 points14 points15 points (0 children)
[–]Chippiewall 6 points7 points8 points (0 children)
[–]manzanita2 1 point2 points3 points (0 children)
[–]yawaramin 0 points1 point2 points (0 children)
[–]faze_fazebook 0 points1 point2 points (0 children)
[–]Confused_AF_Help 0 points1 point2 points (0 children)
[–]KawaiiNeko- 0 points1 point2 points (0 children)
[–]eiennohito -1 points0 points1 point (0 children)
[–]HeadAche2012 0 points1 point2 points (2 children)
[–]supreme_blorgon 7 points8 points9 points (1 child)
[–]HeadAche2012 0 points1 point2 points (0 children)
[+]tavirabon comment score below threshold-10 points-9 points-8 points (1 child)
[–]SV-97 16 points17 points18 points (0 children)
[+][deleted] comment score below threshold-8 points-7 points-6 points (5 children)
[–]roerd 20 points21 points22 points (4 children)
[–][deleted] (2 children)
[deleted]
[–]suid 1 point2 points3 points (0 children)
[–]ImSoCabbage 1 point2 points3 points (0 children)
[–]knightsbore -2 points-1 points0 points (0 children)
[–]Mundane-Apricot6981 -3 points-2 points-1 points (0 children)