-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 685: Minor wording changes #2448
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -26,7 +26,7 @@ The `Provides-Extra`_ core metadata specification states that an extra's | |||||||||
name "must be a valid Python identifier". | ||||||||||
:pep:`508` specifies that the value of an ``extra`` marker may contain a | ||||||||||
letter, digit, or any one of ``.``, ``-``, or ``_`` after the initial character. | ||||||||||
Otherwise, there is no other `PyPA specification | ||||||||||
There is no other `PyPA specification | ||||||||||
<https://packaging.python.org/en/latest/specifications/>`_ | ||||||||||
which outlines how extra names should be written or normalized for comparison. | ||||||||||
Due to the amount of packaging-related code in existence, | ||||||||||
|
@@ -59,7 +59,7 @@ via:: | |||||||||
re.sub(r'[^A-Za-z0-9-.]+', '_', name).lower() | ||||||||||
|
||||||||||
The use of an underscore/``_`` differs from PEP 503's use of a hyphen/``-``, | ||||||||||
and it also normalizes characters outside of those allowed by :pep`508`. | ||||||||||
and it also normalizes characters outside of those allowed by :pep:`508`. | ||||||||||
Runs of ``.`` and ``-``, unlike PEP 503, do **not** get normalized to one ``_``, | ||||||||||
e.g. ``..`` stays the same. To note, this is inconsistent with this function's | ||||||||||
docstring, which *does* specify that all non-alphanumeric characters | ||||||||||
|
@@ -95,10 +95,10 @@ Tools generating metadata MUST raise an error if a user specified | |||||||||
two or more extra names which would normalize to the same name. | ||||||||||
Tools generating metadata MUST raise an error if an invalid extra | ||||||||||
name is provided as appropriate for the specified core metadata version. | ||||||||||
If an older core metadata version is specified and the name would be | ||||||||||
If a project's metadata specifies an older core metadata version and the name would be | ||||||||||
invalid with newer core metadata versions, | ||||||||||
tools SHOULD warn the user. | ||||||||||
Tools SHOULD warn users when an invalid extra name is read and SHOULD not use | ||||||||||
tools reading that metadata SHOULD warn the user. | ||||||||||
Tools SHOULD warn users when an invalid extra name is read and SHOULD ignore | ||||||||||
the name to avoid ambiguity. | ||||||||||
Comment on lines
+101
to
102
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.
Suggested change
Maybe I'm splitting hairs, but for clarity's sake, wouldn't it be the extra that is ignored, (i.e. not installed), not just the name used for it? 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. I don't see there's a significant difference, but I'm not sufficiently bothered that I'll argue either way. Both "extra" and "name" clearly (IMO) refer back to the term "extra name". Note that this sentence doesn't necessarily refer to installers - the tool might be an analysis utility that's reporting what extras are present in a set of projects, for example. |
||||||||||
Tools MAY raise an error instead of a warning when reading an | ||||||||||
invalid name, if they so desire. | ||||||||||
|
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.
Oops, I didn't catch this; surprised it didn't result in a Sphinx-level syntax error. I could have the linters check for cases like this, but I'm not sure if its common or general enough to justify.