mirror of
https://github.com/pacnpal/django-anymail.git
synced 2025-12-20 03:41:05 -05:00
DRY up duplicate content in the readme and docs index page.
* Don't maintain similar overview in README.rst and docs/index.rst -- instead just include relevant portions of readme in the docs * Patch up README version numbers and doc links in setup.py long_description to freeze them to the version being setup * Suppress the Travis build status indicator in the docs and PyPI, since it can't be frozen to the specific version in question
This commit is contained in:
23
setup.py
23
setup.py
@@ -1,15 +1,26 @@
|
||||
from setuptools import setup
|
||||
execfile('djrill/_version.py')
|
||||
import re
|
||||
execfile('djrill/_version.py') # defines __version__, __minor_version__
|
||||
|
||||
with open('LICENSE') as file:
|
||||
license_text = file.read()
|
||||
with open('README.rst') as file:
|
||||
long_description = file.read()
|
||||
|
||||
def long_description_from_readme(rst):
|
||||
# Patch up some rest substitution variables (references only - not definitions):
|
||||
rst = re.sub(r'(?<!\.\. )\|release\|', __version__, rst)
|
||||
rst = re.sub(r'(?<!\.\. )\|version\|', __minor_version__, rst)
|
||||
rst = re.sub(r'(?<!\.\. )\|buildstatus\|', "", rst) # hide latest-code Travis status indicator
|
||||
rst = re.sub(r'(djrill\.readthedocs\.org/\w+)/latest',
|
||||
r'\1/' + __version__, rst) # freeze docs link to this version
|
||||
return rst
|
||||
|
||||
with open('LICENSE') as f:
|
||||
license_text = f.read()
|
||||
with open('README.rst') as f:
|
||||
long_description = long_description_from_readme(f.read())
|
||||
|
||||
setup(
|
||||
name="djrill",
|
||||
version=__version__,
|
||||
description='Django email backend for Mandrill.',
|
||||
description='Mandrill transactional email for Django',
|
||||
keywords="django, mailchimp, mandrill, email, email backend",
|
||||
author="Kenneth Love <kenneth@brack3t.com>, Chris Jones <chris@brack3t.com>",
|
||||
author_email="kenneth@brack3t.com",
|
||||
|
||||
Reference in New Issue
Block a user