PEP 751: add `editable` to `packages.directory` (#3888)

* PEP 751: add `editable` to `packages.directory`
Along the way address some other comments.
This commit is contained in:
Brett Cannon 2024-08-02 16:42:40 -07:00 committed by GitHub
parent b59f591483
commit 40e8ff87a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 39 additions and 15 deletions

View File

@ -46,9 +46,17 @@ what would be installed into an environment ahead of time.
The lack of a standard also has some drawbacks. For instance, any tooling that The lack of a standard also has some drawbacks. For instance, any tooling that
wants to work with lock files must choose which format to support, potentially wants to work with lock files must choose which format to support, potentially
leaving users unsupported (e.g., if Dependabot_ chose not to support PDM, leaving users unsupported (e.g., Dependabot_ only supporting select tools,
support by cloud providers who can do dependency installations on your behalf, same for cloud providers who can do dependency installations on your behalf,
etc.). etc.). It also impacts portability between tools, which causes vendor lock-in.
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 and making it costly to use/switch to other formats. Rallying
around a single format removes that cost/barrier.
.. note::
Much of the motivation from :pep:`665` also applies to this PEP.
========= =========
@ -424,7 +432,7 @@ unless otherwise specified for the same reason.
``[[packages.files]]`` ``[[packages.files]]``
---------------------- ----------------------
- Must be specified if ``[packages.vcs]`` and ``packages.directory`` is not - Must be specified if ``[packages.vcs]`` and ``[packages.directory]`` is not
(although may be specified simultaneously with the other options). (although may be specified simultaneously with the other options).
- Array of tables - Array of tables
- Tables can be written inline. - Tables can be written inline.
@ -470,10 +478,12 @@ unless otherwise specified for the same reason.
- Optional - Optional
- String - String
- URI where the file was found when the lock file was generated. - URI where the file was found when the lock file was generated.
- If the URI is a relative file path, it is considered relative to the lock
file.
- Useful for documenting where the file was originally found and potentially - Useful for documenting where the file was originally found and potentially
where to look for the file if not already downloaded/available. where to look for the file if it is not already downloaded/available.
- Installers MUST NOT assume the URL will always work, but installers MAY use - Installers MUST NOT assume the URI will always work, but installers MAY use
the URL if it happens to work. the URI if it happens to work.
``packages.files.hash`` ``packages.files.hash``
@ -489,8 +499,8 @@ unless otherwise specified for the same reason.
``[packages.vcs]`` ``[packages.vcs]``
------------------ ------------------
- Must be specified if ``[[packages.files]]`` and ``packages.directory`` is not - Must be specified if ``[[packages.files]]`` and ``[packages.directory]`` is
(although may be specified simultaneously with the other options). not (although may be specified simultaneously with the other options).
- Table representing the version control system containing the package and - Table representing the version control system containing the package and
version. version.
@ -534,16 +544,30 @@ unless otherwise specified for the same reason.
version. version.
``packages.directory`` ``[packages.directory]``
---------------------- ------------------------
- Must be specified if ``[[packages.files]]`` and ``packages.vcs`` is not - Must be specified if ``[[packages.files]]`` and ``[packages.vcs]`` is not
and doing per-package locking. and doing per-package locking.
- Table representing a source tree found on the local file system.
``packages.directory.path``
'''''''''''''''''''''''''''
- String - String
- A local directory where a source tree for the package and version exists. - A local directory where a source tree for the package and version exists.
- Not valid under ``[[file-locks]]`` as this PEP does not make an attempt to - The path MUST use forward slashes as the path separator.
specify a mechanism for verifying file contents have not changed since locking - If the path is relative it is relative to the location of the lock file.
was performed.
``packages.directory.editable``
'''''''''''''''''''''''''''''''
- Boolean
- Optional (defaults to ``false``)
- Flag representing whether the source tree should be installed as an editable
install.
``[[packages.build-requires]]`` ``[[packages.build-requires]]``