Skip to content

Convert README.md to rst in setup.py #135

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
wants to merge 1 commit into from

Conversation

dhimmel
Copy link
Contributor

@dhimmel dhimmel commented Mar 5, 2017

Currently, the package description on PyPI displays the raw markdown text from README.md. This occurs because PyPI only accepts reStructuredText for package descriptions. This pull request enables formatted descriptions for future PyPI releases by converting the README to rst.

Pandoc is used for the conversion. If pandoc is not installed, then the markdown README is passed to long_description. I've looked into several solutions to the README formatting issue with PyPI and think this is the best. As long as the machine which builds the package to send to PyPI has Pandoc, the PyPI page will be pretty.

Enable formatted descriptions for future PyPI releases.
@dhimmel
Copy link
Contributor Author

dhimmel commented Mar 5, 2017

Note if you want to use Pandoc on Travis (pending #86). The pandoc version available from the Ubuntu precise channel is too old to perform this conversion (it has a bug).

Therefore, you can add the following lines to your .travis.yml:

dist: trusty
sudo: false
addons:
  apt_packages:
    - pandoc

This options will use trusty rather than precise and automatically install pandoc. This will come in handy if you want to use Travis to automate PyPI deployment (may not be a good idea for security critical repositories).

@matejcik
Copy link

it's now possible to use Markdown on PyPI, if you specify long_description_content_type="text/markdown" in setup.py

@dhimmel
Copy link
Contributor Author

dhimmel commented Jan 16, 2019

Closing this as it's superseded by #172 / 45be64a.

@dhimmel dhimmel closed this Jan 16, 2019
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

Successfully merging this pull request may close these issues.

2 participants