Skip to content

Commit 40f43fc

Browse files
committed
fix: use correct rendering of long_description in setup.py
1 parent 51c9c9a commit 40f43fc

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

setup.py

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,6 @@
3838
os.system('python setup.py sdist upload -r pypi')
3939
sys.exit()
4040

41-
# Convert README.md to README.rst for pypi
42-
try:
43-
from pypandoc import convert_file
44-
45-
def read_md(f):
46-
return convert_file(f, 'rst')
47-
48-
# read_md = lambda f: convert(f, 'rst')
49-
except:
50-
print('warning: pypandoc module not found, '
51-
'could not convert Markdown to RST')
52-
53-
def read_md(f):
54-
return open(f, 'rb').read().decode(encoding='utf-8')
55-
# read_md = lambda f: open(f, 'rb').read().decode(encoding='utf-8')
56-
57-
5841
class PyTest(TestCommand):
5942
def finalize_options(self):
6043
TestCommand.finalize_options(self)
@@ -74,7 +57,9 @@ class PyTestIntegration(PyTest):
7457
def finalize_options(self):
7558
self.test_args = ['--strict', '--verbose', '--tb=long', 'test/integration']
7659

77-
60+
with open("README.md", "r") as fh:
61+
readme = fh.read()
62+
7863
setup(name=PACKAGE_NAME.replace('_', '-'),
7964
version=__version__,
8065
description=PACKAGE_DESC,
@@ -84,7 +69,8 @@ def finalize_options(self):
8469
cmdclass={'test': PyTest, 'test_unit': PyTestUnit, 'test_integration': PyTestIntegration},
8570
author='IBM',
8671
author_email='[email protected]',
87-
long_description=read_md('README.md'),
72+
long_description=readme,
73+
long_description_content_type='text/markdown',
8874
url='https://github.com/IBM/platform-services-python-sdk',
8975
packages=[PACKAGE_NAME],
9076
include_package_data=True,

0 commit comments

Comments
 (0)