diff --git a/setup.py b/setup.py index 93de7602..aa445007 100755 --- a/setup.py +++ b/setup.py @@ -2,19 +2,27 @@ from setuptools import setup, find_packages import os +import subprocess from bitcoin import __version__ here = os.path.abspath(os.path.dirname(__file__)) -with open(os.path.join(here, 'README.md')) as f: - README = f.read() +readme_path = os.path.join(here, 'README.md') +try: + args = 'pandoc', '--from', 'markdown', '--to', 'rst', readme_path + readme = subprocess.check_output(args).decode() +except Exception as error: + print('README.md conversion to reStructuredText failed. Error:') + print(error) + with open(readme_path) as read_file: + readme = read_file.read() requires = [] setup(name='python-bitcoinlib', version=__version__, description='The Swiss Army Knife of the Bitcoin protocol.', - long_description=README, + long_description=readme, classifiers=[ "Programming Language :: Python", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",