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

RST vs MD #19

Open
sdgathman opened this issue Jan 2, 2020 · 5 comments
Open

RST vs MD #19

sdgathman opened this issue Jan 2, 2020 · 5 comments

Comments

@sdgathman
Copy link
Owner

Github wants markdown, PyPi wants RST. My attempt to make README.md compatible with both failed. Do we maintain both README.md and README.rst ? Is there a convert ? Is there a previewer (web or otherwise) for RST? Can I reupload versions to debug README to test.pypi.org? So many questions.

@kitterma
Copy link
Collaborator

kitterma commented Jan 2, 2020

It's a distutils versus setuptools thing I think. You've got long_description_content_type='text/markdown', in setup.py, but it's not recognized (with twine check I get:

Checking distribution dist/pyspf-2.0.14.tar.gz: warning: long_description_content_type missing. defaulting to text/x-rst.

If I switch to setuptools, the error goes away:

diff --git a/setup.py b/setup.py
index a64521c..35843f1 100755
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
#!/usr/bin/python

-from distutils.core import setup
+from setuptools import setup
import sys

DESC = """SPF (Sender Policy Framework) implemented in Python."""

If we change to setuptools, we can also specify dependencies in setup.py so users don't have to install them by hand. If you're OK wiith it, I'll make the change.

@sdgathman
Copy link
Owner Author

sdgathman commented Jan 2, 2020

Yes, I can change the type to rst, but github wants markdown. The setuptools aren't the issue. Unless you're saying pypi does support markdown, but twine just syntax checks as RST.

@sdgathman
Copy link
Owner Author

Currently, the content type says markdown, and the file is named README.md - and yet pypi still interprets it as RST. So it is pretty clear that the title of this issue is accurate. We have to support two different markdown syntaxes. Or adopt a subset that works with both. Is there a preformatted syntax that works with both?

@kitterma
Copy link
Collaborator

kitterma commented Jan 3, 2020

Pypi wants rst because of the difference in the PKG-INFO file in the sdist. Here's the diff going from Pkg-Info generated by distutils and setuptools:

diff -ruN pyspf-2.0.14/PKG-INFO pyspf.egg-info/PKG-INFO
--- pyspf-2.0.14/PKG-INFO 2020-01-02 22:25:23.000000000 -0500
+++ pyspf.egg-info/PKG-INFO 2020-01-02 22:24:39.477610691 -0500
@@ -1,10 +1,12 @@
-Metadata-Version: 1.1
+Metadata-Version: 2.1
Name: pyspf
Version: 2.0.14
Summary: SPF (Sender Policy Framework) implemented in Python.
Home-page: https://github.com/sdgathman/pyspf/
-Author: Stuart D. Gathman
-Author-email: [email protected]
+Author: Terence Way
+Author-email: [email protected]
+Maintainer: Stuart D. Gathman
+Maintainer-email: [email protected]
License: Python Software Foundation License
Description: SPF
===
@@ -220,3 +222,4 @@
Classifier: Topic :: Communications :: Email :: Filters
Classifier: Topic :: Internet :: Name Service (DNS)
Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Description-Content-Type: text/markdown

Note the addition of Description-Content-Type when generated with setuptools. If you want to use Markdown for both Github and Pypi, that will solve it.

@kitterma
Copy link
Collaborator

kitterma commented Jan 3, 2020

The Python community has pretty well left distutils behind and focused on setuptools, so even though there are a few things about it I find annoying, it's the future. We may as well switch and solve this.

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

2 participants