mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
use pandoc to convert README.md to PyPI's reST format
PyPI and Python packages expect the description to be in reST format, which is a lot different than Markdown. This does the conversion if pandoc is installed.
This commit is contained in:
parent
faeecf0b07
commit
31e81e83da
@ -1,6 +1,3 @@
|
|||||||
[metadata]
|
|
||||||
description-file = README.md
|
|
||||||
|
|
||||||
[aliases]
|
[aliases]
|
||||||
release = register sdist upload --sign
|
release = register sdist upload --sign
|
||||||
|
|
||||||
|
14
setup.py
14
setup.py
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
import os
|
import os
|
||||||
|
import shutil
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
# workaround issue on OSX or --user installs, where sys.prefix is not an installable location
|
# workaround issue on OSX or --user installs, where sys.prefix is not an installable location
|
||||||
@ -10,10 +11,21 @@ if os.access(sys.prefix, os.W_OK | os.X_OK):
|
|||||||
else:
|
else:
|
||||||
data_prefix = '.'
|
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)
|
||||||
|
else:
|
||||||
|
print('Using Markdown README')
|
||||||
|
with open('README.md') as fp:
|
||||||
|
readme = fp.read()
|
||||||
|
|
||||||
setup(name='fdroidserver',
|
setup(name='fdroidserver',
|
||||||
version='0.8',
|
version='0.8',
|
||||||
description='F-Droid Server Tools',
|
description='F-Droid Server Tools',
|
||||||
long_description=open('README.md').read(),
|
long_description=readme,
|
||||||
author='The F-Droid Project',
|
author='The F-Droid Project',
|
||||||
author_email='team@f-droid.org',
|
author_email='team@f-droid.org',
|
||||||
url='https://f-droid.org',
|
url='https://f-droid.org',
|
||||||
|
Loading…
Reference in New Issue
Block a user