-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PEP 639: minor edits for clarity and consistency #3921
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -339,7 +339,7 @@ Build and publishing tools SHOULD | |
check that the ``License-Expression`` field contains a valid SPDX expression, | ||
including the validity of the particular license identifiers | ||
(as :ref:`defined above <639-spdx>`). | ||
Tools MAY halt execution and raise an error when an invalid expression is found. | ||
Tools MAY raise an error when an invalid expression is found. | ||
If tools choose to validate the SPDX expression, they also SHOULD | ||
store a case-normalized version of the ``License-Expression`` | ||
field using the reference case for each SPDX license identifier and uppercase | ||
|
@@ -367,12 +367,10 @@ Add ``License-File`` field | |
'''''''''''''''''''''''''' | ||
|
||
``License-File`` is an optional :term:`Core Metadata field`. | ||
Each instance contains the string | ||
representation of the path of a license-related file. The path is located | ||
within the :term:`project source tree`, relative to the | ||
:term:`project root directory`. | ||
It is a multi-use field that may appear zero or | ||
more times and each instance lists the path to one such file. Files specified | ||
It is a multi-use field that may appear zero or more times, where each instance | ||
contains the string representation of the path of a license-related file. The | ||
path is located within the :term:`project source tree`, relative to the | ||
:term:`project root directory`. Files specified | ||
under this field could include license text, author/attribution information, | ||
or other legal notices that need to be distributed with the package. | ||
|
||
|
@@ -388,8 +386,8 @@ If a ``License-File`` is listed in a | |
- That file MUST be included in the :term:`distribution archive` at the | ||
specified path relative to the root license directory. | ||
|
||
- That file MUST be installed with the :term:`project` at that same relative | ||
path. | ||
- That file MUST be installed with the :term:`project` at that same path | ||
relative to the root license directory. | ||
|
||
- The specified relative path MUST be consistent between project source trees, | ||
source distributions (sdists), built distributions (:term:`Wheel`\s) and | ||
|
@@ -453,7 +451,7 @@ is deprecated and replaced by the more precise ``License-Expression`` field. | |
|
||
If the ``License-Expression`` field is present, build tools MAY raise an error | ||
if one or more license classifiers | ||
is included in a ``Classifier`` field, and MUST NOT add | ||
are included in a ``Classifier`` field, and MUST NOT add | ||
such classifiers themselves. | ||
|
||
Otherwise, if this field contains a license classifier, | ||
|
@@ -483,10 +481,10 @@ metadata under a ``[project]`` table in the ``pyproject.toml`` file. | |
Add string value to ``license`` key | ||
''''''''''''''''''''''''''''''''''' | ||
|
||
``license`` key in the ``[project]`` table is defined to contain a top-level | ||
The ``license`` key in the ``[project]`` table is defined to contain a top-level | ||
string value. It is a valid SPDX license expression as | ||
:ref:`defined in this PEP <639-spdx>`. | ||
Its value maps to the ``License-Expression`` field in the core metadata. | ||
Its value maps to the ``License-Expression`` field in the Core Metadata. | ||
|
||
Build tools SHOULD validate and perform case normalization of the expression | ||
as described in the | ||
|
@@ -518,7 +516,7 @@ Add ``license-files`` key | |
A new ``license-files`` key is added to the ``[project]`` table for specifying | ||
paths in the project source tree relative to ``pyproject.toml`` to file(s) | ||
containing licenses and other legal notices to be distributed with the package. | ||
It corresponds to the ``License-File`` fields in the Core Metadata. | ||
It corresponds to the ``License-File`` field in the Core Metadata. | ||
|
||
Its value is an array of strings which MUST contain valid glob patterns, | ||
as specified below: | ||
|
@@ -624,7 +622,7 @@ the ``license-files`` key instead. | |
|
||
If the specified license ``file`` is present in the source tree, | ||
build tools SHOULD use it to fill the ``License-File`` field | ||
in the core metadata, and MUST include the specified file | ||
in the Core Metadata, and MUST include the specified file | ||
as if it were specified in a ``license-file`` field. | ||
If the file does not exist at the specified path, | ||
tools MUST raise an informative error as previously specified. | ||
|
@@ -638,7 +636,7 @@ from a new version of the specification in a future PEP. | |
License files in project formats | ||
-------------------------------- | ||
|
||
A few additions will be made to the existing specifications. | ||
A few additions will be made to the existing specifications: | ||
|
||
:term:`Project source tree`\s | ||
Per :ref:`639-spec-source-metadata` section, the | ||
|
@@ -668,12 +666,10 @@ A few additions will be made to the existing specifications. | |
:term:`Installed project`\s | ||
The `Recording Installed Projects specification <installedspec_>`__ will be | ||
updated to reflect that if the ``Metadata-Version`` is ``2.4`` or greater | ||
and one or more ``License-File`` fields is specified, the ``.dist-info`` | ||
and one or more ``License-File`` fields is specified, the installed ``.dist-info`` | ||
directory MUST contain a ``licenses`` subdirectory which MUST contain | ||
the files listed in the ``License-File`` fields in the ``METADATA`` file | ||
at their respective paths relative to the ``licenses`` directory, | ||
and that any files in this directory MUST be copied from wheels | ||
by install tools. | ||
at their respective paths relative to the ``licenses`` directory. | ||
|
||
|
||
.. _639-spec-converting-metadata: | ||
|
@@ -718,10 +714,10 @@ The new ``license-files`` key in the ``[project]`` table of | |
``pyproject.toml`` will only have an effect once users and tools adopt it. | ||
|
||
This PEP specifies that license files should be placed in a dedicated | ||
``licenses`` subdir of ``.dist-info`` directory. This is new and ensures that | ||
wheels following this PEP will have differently-located licenses relative to | ||
those produced via the previous installer-specific behavior. This is further | ||
supported by a new metadata version. | ||
``licenses`` subdirectory of the ``.dist-info`` directory. This is new and | ||
ensures that wheels following this PEP will have differently-located licenses | ||
relative to those produced via the previous installer-specific behavior. This | ||
is further supported by a new metadata version. | ||
|
||
This also resolves current issues where license files are accidentally | ||
replaced if they have the same names in different places, making wheels | ||
|
@@ -777,7 +773,7 @@ packaging tools may warn them and inform them of the replacement, | |
Tools may also help with the conversion and suggest a license expression in | ||
many common cases: | ||
|
||
- The appendix :ref:`639-spec-mapping-classifiers-identifiers` provides | ||
- The :ref:`639-spec-mapping-classifiers-identifiers` provides | ||
Comment on lines
-780
to
+776
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
tool authors with recommendation on how to suggest a license expression | ||
produced from legacy classifiers. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The clause "and that any files in this directory MUST be copied from wheels by install tools" has two potential interpretations:
License-File
Core Metadata field in the wheel distribution MUST be copied into this directory. This isn't wrong, but it is redundant with the earlier text. Simply stating that we're talking about the installed.dist-info
directory should suffice IMO.License-File
Core Metadata field are permitted to be in this directory. If this is the case, I'd suggest adding the word "only" somewhere.I initially read the line under the second interpretation, but that seems wrong? I'd appreciate your thoughts @befeleme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I'm not the original author, let me provide another interpretation - how I see it: PEP doesn't specify nor forbid what else, except for the files listed under the
License-File
fields can be listed in the.dist-info/licenses
directory, but it ensures that whatever is there (e.g. filled in by a build backend custom means), will always be installed with the copies of the software. Hence the partial redundancy of the wording.