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

Publish Requires-Dist for source distributions when using setup.cfg? #1805

Open
di opened this issue Jul 23, 2019 · 5 comments
Open

Publish Requires-Dist for source distributions when using setup.cfg? #1805

di opened this issue Jul 23, 2019 · 5 comments

Comments

@di
Copy link
Member

di commented Jul 23, 2019

Consider the following example:

setup.py:

from setuptools import setup

setup()

setup.cfg:

[metadata]
name = setup-cfg-example
version = 0.0.0
[options]
install_requires =
    foobar

When building a built distribution, the following metadata is produced:

Metadata-Version: 2.1
Name: setup-cfg-example
Version: 0.0.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Platform: UNKNOWN
Requires-Dist: foobar

UNKNOWN

However for the same source distribution:

Metadata-Version: 1.0
Name: setup-cfg-example
Version: 0.0.0
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
Author-email: UNKNOWN
License: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN

In this case, where install_requires is set in setup.cfg and is completely deterministic, should setuptools include Requires-Dist in the metadata for the source distribution?

@jaraco
Copy link
Member

jaraco commented Oct 4, 2019

Yes, that seems reasonable.

@tacaswell
Copy link

Is there any practical consequence on requires_dist being missing?


There only being one (immutable) version of this at the top-level also seems problematic if different wheels (for different Python or platform) have different dependencies (this is very common with packages that depend on numpy).

@jelmer
Copy link

jelmer commented Jun 6, 2022

Apparently one of the consequences is that this field allows package managers to figure out dependencies before they have to go and download the wheel.

@abravalheri
Copy link
Contributor

This requires a "modernization" on how setuptools builds sdist, specifically, we need to make the PKG-INFO file properly aligned with the core metadata specifications.

If anyone would like to contribute, help implementing would be very appreciated.

Some time ago I started to contribute to pypa/packaging#498, but it seems that there is a lot to be discussed there and the maintainers might prefer a different path (so we might start with the implementation inside of setuptools first).

@yosefm
Copy link

yosefm commented Feb 11, 2023

I'd like to help, but I need some direction. Where would you make the change in setuptools? I looked at pypa/packaging#498 but didn't get how it's meant to be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants