diff options
| author | anatoly techtonik <techtonik@gmail.com> | 2012-10-22 20:32:42 +0300 |
|---|---|---|
| committer | anatoly techtonik <techtonik@gmail.com> | 2012-10-22 20:32:42 +0300 |
| commit | e89509b4a75dd077a7c87da186aac829c6ba4f99 (patch) | |
| tree | 1eda34502a9517f6aae7f5a43482d987e210e09b | |
| parent | 69fa64f972dc95b9e9bb583229e20bb117fb7102 (diff) | |
| download | python-setuptools-git-e89509b4a75dd077a7c87da186aac829c6ba4f99.tar.gz | |
Automatically link issues in CHANGES.txt uploaded to PyPI
--HG--
branch : distribute
extra : rebase_source : c5311107dd7fa43d90d6588d898bb40900d348e8
| -rwxr-xr-x | setup.py | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -3,6 +3,7 @@ import sys import os import textwrap +import re # Allow to run setup.py from another directory. os.chdir(os.path.dirname(os.path.abspath(__file__))) @@ -130,6 +131,22 @@ if _being_installed(): from distribute_setup import _before_install _before_install() +# return contents of reStructureText file with linked issue references +def _linkified(rstfile): + bitroot = 'http://bitbucket.org/tarek/distribute' + revision = re.compile(r'\b(issue\s*#?\d+)\b', re.M | re.I) + + rstext = open(rstfile).read() + + anchors = revision.findall(rstext) # ['Issue #43', ...] + anchors = sorted(set(anchors)) + rstext = revision.sub(r'`\1`_', rstext) + rstext += "\n" + for x in anchors: + issue = re.findall(r'\d+', x)[0] + rstext += '.. _`%s`: %s/issue/%s\n' % (x, bitroot, issue) + rstext += "\n" + return rstext dist = setup( name="distribute", @@ -139,7 +156,7 @@ dist = setup( author="The fellowship of the packaging", author_email="distutils-sig@python.org", license="PSF or ZPL", - long_description = open('README.txt').read() + open('CHANGES.txt').read(), + long_description = open('README.txt').read() + _linkified('CHANGES.txt'), keywords = "CPAN PyPI distutils eggs package management", url = "http://packages.python.org/distribute", test_suite = 'setuptools.tests', |
