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

Incorrect syntax for single-line entries in setup.cfg -> [options.extras_require] generates invalid METADATA #2553

pwoolvett opened this issue Feb 3, 2021 · 3 comments


Copy link

pwoolvett commented Feb 3, 2021

I'm not clear just by reading the docs what is the correct way of specifying a single, "complex" dependency (eg with markers, example below).

I'm refering to these lines here: the METADATA file being generated contains incorrect information.

NOTE: As a workaround, and by looking at the setuptools code see here for explanation, changing it into multi-line solves the problem with the metadata. In the example, the following line is being split using ;, which generates invalid METADATA:

gstreamer = kivy_deps.gstreamer~=0.3.1; sys_platform == "win32"

On the other hand, this is correctly parsed as the \n overrides the ;, effectively gathering the whole line as a single entry.

gstreamer =
    kivy_deps.gstreamer~=0.3.1; sys_platform == "win32"

The docuemntation contains an example including this:

pdf = ReportLab>=1.2; RXP
rest = docutils>=0.3; pack ==1.1, ==1.3
  • Would in this case a , be the right thing to use between the sependency and the marker instead of ;?

BTW, I'm coming from here:

Copy link

webknjaz commented Feb 4, 2021

It's probably one of the quirks of the stdlib's configparser module. Not sure if setuptools can do anything about it.

Copy link
Contributor Author

In the documentation it says install_requires is parsed as typelist-semi, which causes the same "outcome": you cannot include a marker in a oneliner because this would cause it to incorrctly split (hence the semi in list-semi). The implementation here and the docs are on the same page (both literally and figuratively, as there's an example including a marker).

I guess the confusion arises from the fact that extras_require is parsed as type section, but its not stated what the sub-section values are parsed as (which also is list-semi).

Given the way configparser works, the current setuptools code must post-process the keys inside configuration (welcome, pyproject.toml). I have no problems with the implementation, but after going through this I think it would help having an example / documentation for the case where an extras_require has markers.

Copy link
Contributor Author

closed by aad7fde

This was referenced Mar 8, 2021
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants