mirror of
https://github.com/jongracecox/anybadge.git
synced 2026-01-08 21:30:30 +01:00
Switch to providing long description as markdown in setup.py
Closes #33
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
m2r
|
||||
restructuredtext_lint
|
||||
pygments
|
||||
pytest
|
||||
pytest-cov
|
||||
18
setup.py
18
setup.py
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user