Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Markdown README as-is on PyPI #99

Merged
merged 1 commit into from
Apr 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 3 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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': [
Expand All @@ -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',
Expand All @@ -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'],
Expand Down