Skip to content

Commit

Permalink
PEP 751: add editable to packages.directory (#3888)
Browse files Browse the repository at this point in the history
* PEP 751: add `editable` to `packages.directory`
Along the way address some other comments.
  • Loading branch information
brettcannon authored Aug 2, 2024
1 parent b59f591 commit 40e8ff8
Showing 1 changed file with 39 additions and 15 deletions.
54 changes: 39 additions & 15 deletions peps/pep-0751.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
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,
support by cloud providers who can do dependency installations on your behalf,
etc.).
leaving users unsupported (e.g., Dependabot_ only supporting select tools,
same for cloud providers who can do dependency installations on your behalf,
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.


=========
Expand Down Expand Up @@ -424,7 +432,7 @@ unless otherwise specified for the same reason.
``[[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).
- Array of tables
- Tables can be written inline.
Expand Down Expand Up @@ -470,10 +478,12 @@ unless otherwise specified for the same reason.
- Optional
- String
- 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
where to look for the file if not already downloaded/available.
- Installers MUST NOT assume the URL will always work, but installers MAY use
the URL if it happens to work.
where to look for the file if it is not already downloaded/available.
- Installers MUST NOT assume the URI will always work, but installers MAY use
the URI if it happens to work.


``packages.files.hash``
Expand All @@ -489,8 +499,8 @@ unless otherwise specified for the same reason.
``[packages.vcs]``
------------------

- Must be specified if ``[[packages.files]]`` and ``packages.directory`` is not
(although may be specified simultaneously with the other options).
- Must be specified if ``[[packages.files]]`` and ``[packages.directory]`` is
not (although may be specified simultaneously with the other options).
- Table representing the version control system containing the package and
version.

Expand Down Expand Up @@ -534,16 +544,30 @@ unless otherwise specified for the same reason.
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.
- Table representing a source tree found on the local file system.


``packages.directory.path``
'''''''''''''''''''''''''''

- String
- 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
specify a mechanism for verifying file contents have not changed since locking
was performed.
- The path MUST use forward slashes as the path separator.
- If the path is relative it is relative to the location of the lock file.


``packages.directory.editable``
'''''''''''''''''''''''''''''''

- Boolean
- Optional (defaults to ``false``)
- Flag representing whether the source tree should be installed as an editable
install.


``[[packages.build-requires]]``
Expand Down

0 comments on commit 40e8ff8

Please sign in to comment.