Skip to content

Commit

Permalink
Use Description-Content-Type instead of pandoc
Browse files Browse the repository at this point in the history
No need to convert markdown to RST nowadays.
  • Loading branch information
rohanpm committed Jan 9, 2019
1 parent 27bd7e5 commit c95d648
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,4 @@ docs: .PHONY

release: .PHONY
tox -e py35
.tox/py35/bin/pip install pypandoc
.tox/py35/bin/python scripts/release
1 change: 0 additions & 1 deletion scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def push(release_version):


def run():
environ['USE_PANDOC'] = '1'
old_version = get_version()
if not old_version.endswith('.dev0'):
print("Assuming resumption of interrupted release")
Expand Down
15 changes: 8 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
from setuptools import setup
import os


def get_description():
return 'A library of composable Python executors'


def get_long_description():
if os.environ.get('USE_PANDOC') != '1':
return

import pypandoc
converted = pypandoc.convert('README.md', 'rst')
try:
text = open('README.md').read()
except IOError as error:
if error.errno == 2:
return get_description()
raise

# The README starts with the same text as "description",
# which makes sense, but on PyPI causes same text to be
# displayed twice. So let's strip that.
return converted.replace(get_description() + '.\n\n', '', 1)
return text.replace(get_description() + '.\n\n', '', 1)


setup(
Expand All @@ -29,6 +29,7 @@ def get_long_description():
license='GNU General Public License',
description=get_description(),
long_description=get_long_description(),
long_description_content_type='text/markdown',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
Expand Down

0 comments on commit c95d648

Please sign in to comment.