chiark / gitweb /
include README.rst in official release source tarball
authorHans-Christoph Steiner <hans@eds.org>
Thu, 19 Oct 2017 14:41:47 +0000 (16:41 +0200)
committerHans-Christoph Steiner <hans@eds.org>
Thu, 19 Oct 2017 21:16:58 +0000 (23:16 +0200)
README.rst is still the standard for Python libs.

.gitignore
MANIFEST.in
setup.py

index 3bccb197d772d4f9b9f143e8be885fb5ed08cbb2..dda5ae97d0208145eb73a9d571f8523e9e5be95a 100644 (file)
@@ -13,7 +13,7 @@ env/
 fdroidserver.egg-info/
 pylint.parseable
 /.testfiles/
-docs/html/
+README.rst
 
 # files generated by tests
 tmp/
index 031fccc607fa59503627c401cc84eeb30efc249f..10f4c7ce51319d14df70ae693ca7eaebc15bc191 100644 (file)
@@ -27,7 +27,7 @@ include examples/template.yml
 include fdroid
 include LICENSE
 include makebuildserver
-include README.md
+include README.rst
 include tests/androguard_test.py
 include tests/bad-unicode-*.apk
 include tests/build.TestCase
index 15544732e01a20f1f29cc71093a4ca5cf09be4b4..4a68053674044a2989855d7c33c9372f9fab1c4d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -12,15 +12,20 @@ else:
     data_prefix = '.'
 
 # PyPI accepts reST not Markdown
-if shutil.which('pandoc'):
-    print('Using reST README')
-    import subprocess
-    readme = subprocess.check_output(['pandoc', '--from=markdown', '--to=rst', 'README.md'],
-                                     universal_newlines=True)
+if os.path.exists('README.md'):
+    if shutil.which('pandoc'):
+        print('Using reST README')
+        import subprocess
+        subprocess.check_call(['pandoc', '--from=markdown', '--to=rst', 'README.md',
+                               '--output=README.rst'], universal_newlines=True)
+        with open('README.rst') as fp:
+            readme = fp.read()
+    else:
+        print('Using Markdown README')
+        with open('README.md') as fp:
+            readme = fp.read()
 else:
-    print('Using Markdown README')
-    with open('README.md') as fp:
-        readme = fp.read()
+    readme = ''
 
 setup(name='fdroidserver',
       version='0.8',