-
Notifications
You must be signed in to change notification settings - Fork 932
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
long_description vs. pyproject.toml #1535
Comments
I think the part about setting the type automatically might be backend-specific (as in setuptools would do this and some other backend wouldn't, maybe). FWIW here's an example of how you can specify it explicitly: https://github.com/cherrypy/cheroot/blob/f156ccd/pyproject.toml#L68-L70. P.S. |
Setting the type automatically for
I'm not sure what the situation is with |
Don't forget to always run this early in your CI pipeline with the |
This was suggested by webknjaz.[1] [1]: pypa/packaging.python.org#1535 (comment)
I recently uploaded my first package to PyPI and immediately discovered that I didn't get the nice long description that all the other packages have. As it turns out, this is because I didn't have a
long_description
field set when uploading, which was news to me. I feel that the the basic "Here's how you set up your firstpyproject.toml
" instructions should include something about that (properly explained in light of further notes below).I can't recall now where I was sent in this documentation to fix this (or how I got to a link that sent me there), but I think I eventually ended up at Making a PyPI-friendly README, which is clearly relevant documentation. However, this mentions nothing about
pyproject.toml
and only suggests that you add Python code tosetup.py
that does aread_text()
onREADME.md
, and manually pass that andlong_description_content_type='text/markdown'
to thesetup()
function.After some searching about, it appears that the correct (and far easier) way to do this is simply to add
readme = 'README.md'
to the[project]
section ofpyproject.toml
, which will setlong_description
to the contents of that file and, based on the extension,long_description_content_type = 'text/markdown'
.This should be documented there, and somewhere (possibly on the same page) should be an explanation that this generates the long description section on PyPI.org.
Ideally, there would also be something somewhere that shows how to generate the stuff that appears in the left-hand bar on PyPI.org, too, such as the home page, GitHub repo, etc.
#971 may be related to this, though that's about two and a half years old and is talking about using
setup.cfg
rather thanpyproject.toml
.The text was updated successfully, but these errors were encountered: