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

Official support for markdown and plain text descriptions #169

Merged
merged 4 commits into from
Apr 6, 2018

Conversation

takluyver
Copy link
Member

Fixes #166.

Until recently, PyPI only supported rst descriptions, falling back to plain text if the rst was invalid. Now a new metadata field Description-Content-Type lets us specify whether the description is rst, markdown or plain text. This new code uses that, picking the content type based on the file extension (.rst, .md or .txt). If the extension is something else, Flit will warn the user and leave the field unset, so it's up to PyPI what to do with it.

Markdown support has been a secret feature of Flit for some time, by using pandoc to convert markdown to rst (thanks @Carreau!). This makes it an official feature, and gets rid of the code to call pandoc, since PyPI can now handle markdown natively.

@Carreau
Copy link
Contributor

Carreau commented Apr 6, 2018

There is now a variant type being GFM (default. GitHub FLavored Markdown), or CommonMark.

I don't think it will import (much), but we should have an option to set the variant.

I' havent dive in the code, runnign to lunch.

@takluyver
Copy link
Member Author

This is partly laziness, but I'm inclined to ship it without that option (i.e. all markdown will be GFM for now), and add it later if people want it.

@Carreau
Copy link
Contributor

Carreau commented Apr 6, 2018

The charset seem to also be an option I'm in favor of enforcing utf-8 and/or adding a markdown-variant flag in a subsequent PR.

Copy link
Contributor

@Carreau Carreau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to merge as is, we can take care of the md variant in a separate PR if you like.

@takluyver
Copy link
Member Author

The spec says about charset:

The only legal value is UTF-8. If omitted, it is assumed to be UTF-8.

We already read the file as UTF-8, so it will fail if you point it to a file that isn't valid UTF-8. So I don't think there's anything to do on that front.

@takluyver takluyver merged commit f11f260 into master Apr 6, 2018
@takluyver takluyver deleted the description-content-type branch April 6, 2018 20:12
@flying-sheep flying-sheep mentioned this pull request May 29, 2018
@glyph glyph mentioned this pull request Jul 18, 2018
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.

None yet

2 participants