Skip to content

Unlike legacy PyPI, Warehouse does not import /README.rst if no long_description is provided #3630

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

Closed
bskinn opened this issue Apr 11, 2018 · 5 comments

Comments

@bskinn
Copy link
Contributor

bskinn commented Apr 11, 2018

This is sort of related to #790 and #3473, but different.

IIRC, if you uploaded a file to legacy PyPI that was built with no long_description provided to setup(), it would automatically search for /README.rst and use its contents for long_description instead. I believe this is what happened for, e.g., v1.0 of my sphobjinv package.

However, when I recently uploaded a .post1 release for that package, through Warehouse, it appears not to have auto-retrieved my README.rst into long_description.

This appears to have happened to others, too, up to and including Django. While they seem to have some formatting issues with their README in some releases (perhaps similar to, e.g., #2656?), v1.18.3, released in 2016, does display on Warehouse with a long_description, whereas the most recent version, v2.0.4, does not. For both releases, long_description is not provided in setup.py (v1.18.3 || v2.0.4).

I'm personally agnostic as to whether or not Warehouse auto-retrieves /README.rst, but if the regression of the behavior is going to be permanent, it might be good to advertise it somewhere -- anyone used to the legacy behavior will probably get thrown off when suddenly their README content stops getting pulled into long_description.

@brainwane
Copy link
Contributor

Thanks for the report, @bskinn. Could this be something that is happening in setuptools or wheel rather than Warehouse or readme_renderer? @jonparrott do you have a moment to look into this?

@bskinn
Copy link
Contributor Author

bskinn commented Apr 12, 2018

@brainwane Ahhh, good point, you're right. It might well be occurring before Warehouse even sees it.

I always upload both as sdist and Windows bdist_wheel, so the change probably isn't in wheel. setuptools could be the culprit.

@di
Copy link
Member

di commented Apr 12, 2018

Looking at the PKG-INFO for sphobjinv-1.0.post1.tar.gz and the METADATA for sphobjinv-1.0.post1-py3-none-any.whl, both have a description of UNKNOWN, which is usually set by distutils when a description is not provided when building a distribution.

It's possible that pulling in README.rst when this is the case might have once been the behavior of pypi-legacy, but going forward, Warehouse will not do any introspection of the distributions or make any assumptions about what is intended, so you'll get exactly what's specified in the metadata.

You can check your packages' description with the readme_renderer project, which has this output when run on sphobjinv-1.0.post1:

$ pip install readme_renderer
...
$ python setup.py check -r -s
running check
warning: Check: The project's long_description is either missing or empty.

error: Please correct your package.

Since It looks like you've already added long_description to your setup.py, which will fix this issue for you going forward, and since there won't be any changes to Warehouse to support this, I'm going to close this issue, but thanks for the report!

@di di closed this as completed Apr 12, 2018
@brainwane
Copy link
Contributor

@bskinn when I have a Python packaging problem and it turns out to be somewhere in the toolchain but I'm not sure where, https://github.com/pypa/packaging-problems/issues/ is a good place to open an issue - if you do that, please do link back here.

@dstufft
Copy link
Member

dstufft commented Apr 12, 2018

FWIW the original post was correct, legacy automatically introspected the package to find README.rst, and Warehouse does not do that. That is a purposeful change.

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

No branches or pull requests

4 participants