1. Ahmad Khayyat
  2. mezzanine-pagedown

Commits

Ahmad Khayyat  committed 5dac4c2

Use README.txt if present in setup.py

The original README.md is written in markdown.
PyPI recognizes only restructured text (rst).
If README.txt is present (converted from README.md using pandoc),
use it for long_description in setup.py.
Otherwise, use the markdown version (README.md).

  • Participants
  • Parent commits 77f8214
  • Branches default

Comments (0)

Files changed (1)

File setup.py

View file
  • Ignore whitespace
 from distutils.core import setup
 
+import os
+if os.path.exists("README.txt"):
+    readme = open("README.txt")
+else:
+    print "Warning: using markdown README"
+    readme = open("README.md")
+
 setup(
     name = "mezzanine-pagedown",
     version = "0.1",
     description = "PageDown rich text widget for Mezzanine",
-    long_description = open("README.md").read(),
+    long_description = readme.read(),
     author = "Ahmad Khayyat",
     author_email = "akhayyat@gmail.com",
     license = "BSD",