Skip to content
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

Open
di opened this issue Jan 10, 2025 · 0 comments
Open

[BUG] Deprecated metadata fields are included as Dynamic fields #4797

di opened this issue Jan 10, 2025 · 0 comments
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@di
Copy link
Member

di commented Jan 10, 2025

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 a Dynamic field.

PEP 643 says:

A new field, Dynamic, will be added to the Core Metadata Specification. This field will be multiple use, and will be allowed to contain the name of another core metadata field.

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 and Dynamic was added in 2.2, Requires should never be included as a Dynamic field.

Expected behavior

Setuptools should not write deprecated Core metadata fields to Dynamic.

How to Reproduce

This setup.py:

from setuptools import setup

setup(
    name="test",
    version="0.0.0",
    requires=["foo"],
    install_requires=["bar"],
)

Built with:

$ python -m build -w

Output

This results in the following METADATA file:

Metadata-Version: 2.2
Name: test
Version: 0.0.0
Requires: foo
Requires-Dist: bar
Dynamic: requires
Dynamic: requires-dist
@di di added bug Needs Triage Issues that need to be evaluated for severity and status. labels Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

No branches or pull requests

1 participant