Skip to content

Commit 277e106

Browse files
committed
Avoid converting readme to rST for PyPI upload
PyPI now supports markdown descriptions. See https://dustingram.com/articles/2018/03/16/markdown-descriptions-on-pypi
1 parent f48c087 commit 277e106

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

requirements-dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
wheel
2-
pypandoc==1.4
2+
twine>=1.11.0
3+
setuptools>=38.6.0

setup.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,10 @@
2626
# Extract name and e-mail ("Firstname Lastname <[email protected]>")
2727
AUTHOR, EMAIL = re.match(r'(.*) <(.*)>', AUTHOR_EMAIL).groups()
2828

29-
try:
30-
from pypandoc import convert
31-
read_md = lambda f: convert(f, 'rst')
32-
except ImportError:
33-
print('warning: pypandoc module not found, could not convert '
34-
'Markdown to RST')
35-
read_md = lambda f: open(f, 'r').read()
29+
30+
with open('README.md') as readme:
31+
long_description = readme.read()
32+
3633

3734
CLASSIFIERS = [
3835
'Development Status :: 5 - Production/Stable',
@@ -56,7 +53,8 @@
5653
setup(name=PACKAGE,
5754
version=VERSION,
5855
description=DESCRIPTION,
59-
long_description=read_md('README.md'),
56+
long_description=long_description,
57+
long_description_content_type="text/markdown",
6058
author=AUTHOR,
6159
author_email=EMAIL,
6260
license=LICENSE,

0 commit comments

Comments
 (0)