From fdd4881ee71be9fdfcc95c9ad7adbec893332432 Mon Sep 17 00:00:00 2001 From: "John T. Wodder II" Date: Mon, 19 Apr 2021 11:06:40 -0400 Subject: [PATCH] Use Markdown README as-is on PyPI --- setup.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/setup.py b/setup.py index 50c1c50..4c77bd6 100755 --- a/setup.py +++ b/setup.py @@ -32,20 +32,8 @@ def findsome(subdir, extensions): 'build_examples': BuildRSTExamplesFromScripts, } -# PyPI doesn't render markdown yet. Workaround for a sane appearance -# https://github.com/pypa/pypi-legacy/issues/148#issuecomment-227757822 -README = opj(dirname(__file__), 'README.md') -try: - import pypandoc - long_description = pypandoc.convert(README, 'rst') -except (ImportError, OSError) as exc: - # attempting to install pandoc via brew on OSX currently hangs and - # pypandoc imports but throws OSError demanding pandoc - print( - "WARNING: pypandoc failed to import or thrown an error while converting" - " README.md to RST: %r .md version will be used as is" % exc - ) - long_description = open(README).read() +with open(opj(dirname(__file__), 'README.md')) as fp: + long_description = fp.read() requires = { 'core': [ @@ -54,8 +42,6 @@ def findsome(subdir, extensions): 'scrapy>=1.1.0', # versioning is primarily for python3 support ], 'devel-docs': [ - # used for converting README.md -> .rst for long_description - 'pypandoc', # Documentation 'sphinx', 'sphinx-rtd-theme', @@ -75,6 +61,7 @@ def findsome(subdir, extensions): version=version, description="DataLad extension package for crawling external web resources into an automated data distribution", long_description=long_description, + long_description_content_type="text/markdown", packages=[pkg for pkg in find_packages('.') if pkg.startswith('datalad')], # datalad command suite specs from here install_requires=requires['core'],