Switch to using markdown for package documentation

* Remove the markdown to rst conversion from setup.py.
This commit is contained in:
Jon Grace-Cox
2019-08-12 10:23:12 -04:00
parent c4d06f3e05
commit badd18373c

View File

@@ -2,20 +2,9 @@
import os
import re
from setuptools import setup
from m2r import parse_from_file
import restructuredtext_lint
# Parser README.md into reStructuredText format
rst_readme = parse_from_file('README.md')
# Validate the README, checking for errors
errors = restructuredtext_lint.lint(rst_readme)
# Raise an exception for any errors found
if errors:
print(rst_readme)
raise ValueError('README.md contains errors: ',
', '.join([e.message for e in errors]))
with open('README.md', 'r') as f:
readme_md = '\n'.join(f.readlines())
# Attempt to get version number from TravisCI environment variable
version = os.environ.get('TRAVIS_TAG', default='0.0.0')
@@ -26,7 +15,8 @@ version = re.sub('^v', '', version)
setup(
name='anybadge',
description='Simple, flexible badge generator for project badges.',
long_description=rst_readme,
long_description=readme_md,
long_description_content_type='text/markdown',
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',