Fix setup.py for readme, bis.

This commit is contained in:
Raphaël Barrois 2015-04-01 01:35:00 +02:00
parent ae1f6cdd6d
commit b5c22ec0f8
1 changed files with 2 additions and 0 deletions

View File

@ -26,10 +26,12 @@ def get_version(package_name):
def clean_readme(fname):
"""Cleanup README.rst for proper PyPI formatting."""
with codecs.open(fname, 'r', 'utf-8') as f:
return ''.join(
re.sub(r':\w+:`([^`]+?)( <[^<>]+>)?`', r'``\1``', line)
for line in f
if not (line.startswith('.. currentmodule') or line.startswith('.. toctree'))
)