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

README on pypi.org not readable #17

Closed
vlcinsky opened this issue May 2, 2018 · 14 comments · Fixed by #26
Closed

README on pypi.org not readable #17

vlcinsky opened this issue May 2, 2018 · 14 comments · Fixed by #26

Comments

@vlcinsky
Copy link

vlcinsky commented May 2, 2018

https://pypi.org/project/bump2version/ shows content of README, which is broken.

there seem to be two reasons:

  • the value for long_description is provided as bytes and not as a string
  • the content if formatted as markdown and not reStructuredText

With refactored https://pypi.org well readable README can serve as great presentation of the package and bump2version can definitely do better.

If reStructuredText seems too difficult, I volunteer to write it properly. It is not so difficult and such great tool as bump2version deserves good presentation.

@anthrotype
Copy link
Collaborator

You can also use github flavoured markdown now, if you set the new long_description_type field.

@c4urself
Copy link
Owner

c4urself commented May 2, 2018

@vlcinsky -- thanks for noticing! I really much prefer Markdown and actually rewrote the Readme to markdown recently -- much easier to maintain for me. Let's try @anthrotype's suggestion.

@vlcinsky
Copy link
Author

vlcinsky commented May 2, 2018

Good @c4urself . You are commander of this ship. As I have never used long_description_type, I leave that modification to other experts.

@anthrotype
Copy link
Collaborator

@ekohl
Copy link
Collaborator

ekohl commented May 7, 2018

https://dustingram.com/articles/2018/03/16/markdown-descriptions-on-pypi is the complete story. You also need somewhat new tools to upload the release to send the correct metadata.

@micahjsmith
Copy link

The correct option is long_description_content_type="text/markdown"

@Mattwmaster58
Copy link

Mattwmaster58 commented Jul 17, 2018

sooo what are we waiting for here? A PR? As far as I can tell we need to:

  • set long_description_content_type="text/markdown" in setup.py
  • change
long_description = re.sub(
  "\`(.*)\<#.*\>\`\_",
  r"\1",
  str(open('README.md', 'rb').read()).replace(description, '')
)

to

with open('README.md') as readme:
    long_description = readme.read()

@Mattwmaster58
Copy link

screw it, why not? #24

@vlcinsky
Copy link
Author

@Mattwmaster58 When opening the file, better use explicit encoding (like "utf-8").

@florisla
Copy link
Collaborator

florisla commented Sep 4, 2018

@c4urself Did you upgrade your twine before uploading 0.5.10 to PyPI?

The layout there still seems to be rendered as plain text, not as proper Markdown.
This even though dist-info/METADATA in the Wheel file contains the correct Description-Content-Type.

Also, it seems there's no source distribution (.tar.gz) uploaded at https://pypi.org/simple/bump2version/ .

@c4urself
Copy link
Owner

c4urself commented Sep 4, 2018

@florisla -- I did! I installed twine==1.11.0 and ran the twine upload command, see: https://github.com/c4urself/bump2version/blob/master/Makefile#L12 -- as far as the tar.gz -- I indeed only uploaded the wheel as I thought that's the "future" now?

@ekohl
Copy link
Collaborator

ekohl commented Sep 4, 2018

@c4urself it is good practice to upload both IMHO

@ekohl
Copy link
Collaborator

ekohl commented Sep 4, 2018

@c4urself you also had setuptools>=38.6.0 and wheel>=0.31.0 installed?

@florisla
Copy link
Collaborator

Note: the latest release of twine has a 'check' command, which checks if the README will render correctly on PyPI. See twine docs.

For the next release, I would recommend:

pip install --upgrade pip
pip install --upgrade setuptools
pip install --upgrade wheel
pip install --upgrade twine
pip install readme_renderer[md]
setup.py build sdist
setup.py build bdist_wheel
twine check dist/*

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

Successfully merging a pull request may close this issue.

7 participants