-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[BUG] Deprecated metadata fields are included as Dynamic
fields
#4797
Comments
Thank you very much, @di, for reporting this. I think we need a clarification on the topic. It is not immediate for me that this is what is specified by the standard. My interpretation is that as long as it is a valid metadata field, then it can be Dynamic (the only two fields excluded in the PEP are name and version). Since the field can still be written, although deprecated, it should respect Dynamic, shouldn't it? On a side note: I will double check if setuptools is emitting a warning for people using /cc @pfmoore as the author of the PEP |
My intention was that any field could be marked as Dynamic. I hadn’t considered the case of fields that were deprecated before Dynamic was added, but I think it makes no difference - they are deprecated, but still allowed. I will admit that the core metadata spec isn’t clear on this either - are tools allowed to reject metadata containing deprecated fields? If the answer is “yes” (and making it say that would be a spec change IMO), then my answer here changes. Including fields that were removed in an older version isn’t allowed, though, just the same as it’s not allowed to include an invalid field. But I’m not aware of any fields that have been removed rather than deprecated. I agree that it would be helpful for setuptools to warn (or maybe even outright error if the deprecation is sufficiently old) if a deprecated field is used. |
Thanks. I filed pypa/packaging.python.org#1787 to update the spec and pypi/warehouse#17409 to bring PyPI's behavior inline here. |
setuptools version
75.8.0
Python version
n/a
OS
n/a
Additional environment information
Ref: pypi/warehouse#17389
Description
Since #4698, setuptools will record the deprecated
Requires
field as aDynamic
field.PEP 643 says:
I read this to mean that this can only contain the name of a core metadata field that is valid for the given metadata version, and shouldn't include deprecated fields. Since
Requires
was deprecated in 1.2 andDynamic
was added in 2.2,Requires
should never be included as aDynamic
field.Expected behavior
Setuptools should not write deprecated Core metadata fields to
Dynamic
.How to Reproduce
This
setup.py
:Built with:
Output
This results in the following
METADATA
file:The text was updated successfully, but these errors were encountered: