Switch to providing long description as markdown in setup.py

Closes #33
This commit is contained in:
Jon Grace-Cox
2019-11-16 23:14:29 -05:00
parent 8cb8c5ec1d
commit f337d09a2f
2 changed files with 4 additions and 16 deletions

View File

@@ -1,5 +1,3 @@
m2r
restructuredtext_lint
pygments
pytest
pytest-cov

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', encoding='utf-8') as f:
long_description = f.read()
# 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=long_description,
long_description_content_type='text/markdown',
version=version,
author='Jon Grace-Cox',
author_email='jongracecox@gmail.com',