-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Pip ignores extras_require when description in setup.py contains \n #7010
Comments
The
I don't think that the metadata is valid. Consider:
After replacing the multi-line summary with an encoded version like
and re-zipping, the resulting wheel seems to be installed correctly (with dependencies and extras). |
When building with the poetry-generated
Truncating like this may be better than encoding like I did above, since any other tools may be expecting literally a single line. If you file an issue with Poetry you may want to mention it. |
@chrahunt, thanks fort digging deeper into this! So, it seems I'd better file an issue with Poetry to truncate multi-line descriptions, or flagging it by running |
You did most of the work - it was very clear what to check. :) Thank you for that.
Yup, that's what I would do. |
I will close this now since the issue has been reported over in poetry. Thanks again for such a thorough report! |
Environment
Description
This issue was discovered while publishing docs from undp/MsGraphExporter on ReadTheDocs. When
pyproject.toml
optiondescription
has a multi-line string enclosed in"""
(which is perfectly legit for a string in TOML), it causespoetry
to build the package with thedescription
parameter in thesetup.py
file containing string like'this is\na short description'
which apparently causespip install pkg.whl[docs]
to fail picking upextras_require
option.Expected behavior
Having
\n
inlong_description
ofsetup_kwargs
insetup.py
does not cause such issue. So, I would expect having it indescription
should not affectpip
either.How to re-create the issue
Have the description in the
pyproject.toml
as a multi-line value enclosed in"""
.Check
pyproject.toml
syntax withpoery
.$ poetry check All set!
Build the package with
poetry
Check
setup.py
from the packagetar.gz
to ensure it has allextras_require
defined and also has\n
in thedescription
.Try to install
docs
extra requirements with the package.$ pip install ./dist/ms_graph_exporter-0.1.0rc1-py3-none-any.whl[docs] Processing ./dist/ms_graph_exporter-0.1.0rc1-py3-none-any.whl WARNING: ms-graph-exporter 0.1.0rc1 does not provide the extra 'docs' Installing collected packages: ms-graph-exporter Successfully installed ms-graph-exporter-0.1.0rc1
How to resolve the issue
Ensure
pyproject.toml
has a single-linedescription
.Check
pyproject.toml
syntax withpoery
.$ poetry check All set!
Build the package with
poetry
Check
setup.py
from the packagetar.gz
to ensure it has allextras_require
defined anddescription
without\n
.Install
docs
extra requirements with the package without any issue.Originally posted by @OK-UNDP in readthedocs/readthedocs.org#6151 (comment)
The text was updated successfully, but these errors were encountered: