diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-30 11:39:07 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-30 11:39:07 -0500 |
commit | caea578cd02a7cb2f7cfa453dfabff66e56aff8d (patch) | |
tree | 0ed5a5d71c90be4fc241fa55120ffe50542305e6 /release.py | |
parent | ede1df71401a16c74dea9c1962bd1085538ac3d7 (diff) | |
download | external_python_setuptools-caea578cd02a7cb2f7cfa453dfabff66e56aff8d.tar.gz external_python_setuptools-caea578cd02a7cb2f7cfa453dfabff66e56aff8d.tar.bz2 external_python_setuptools-caea578cd02a7cb2f7cfa453dfabff66e56aff8d.zip |
Moved linkify logic to documentation builder as Sphinx extension.
Diffstat (limited to 'release.py')
-rw-r--r-- | release.py | 40 |
1 files changed, 0 insertions, 40 deletions
@@ -3,7 +3,6 @@ Setuptools is released using 'jaraco.packaging.release'. To make a release, install jaraco.packaging and run 'python -m jaraco.packaging.release' """ -import re import os import subprocess @@ -14,7 +13,6 @@ pkg_resources.require('wheel') def before_upload(): - _linkify('CHANGES.txt', 'CHANGES (links).txt') BootstrapBookmark.add() @@ -33,44 +31,6 @@ test_info = "Travis-CI tests: http://travis-ci.org/#!/jaraco/setuptools" os.environ["SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES"] = "1" -link_patterns = [ - r"(Issue )?#(?P<issue>\d+)", - r"Pull Request ?#(?P<pull_request>\d+)", - r"Distribute #(?P<distribute>\d+)", - r"Buildout #(?P<buildout>\d+)", - r"Old Setuptools #(?P<old_setuptools>\d+)", - r"Jython #(?P<jython>\d+)", - r"Python #(?P<python>\d+)", -] - -issue_urls = dict( - pull_request='https://bitbucket.org' - '/pypa/setuptools/pull-request/{pull_request}', - issue='https://bitbucket.org/pypa/setuptools/issue/{issue}', - distribute='https://bitbucket.org/tarek/distribute/issue/{distribute}', - buildout='https://github.com/buildout/buildout/issues/{buildout}', - old_setuptools='http://bugs.python.org/setuptools/issue{old_setuptools}', - jython='http://bugs.jython.org/issue{jython}', - python='http://bugs.python.org/issue{python}', -) - - -def _linkify(source, dest): - pattern = '|'.join(link_patterns) - with open(source) as source: - out = re.sub(pattern, replacer, source.read()) - with open(dest, 'w') as dest: - dest.write(out) - - -def replacer(match): - text = match.group(0) - match_dict = match.groupdict() - for key in match_dict: - if match_dict[key]: - url = issue_urls[key].format(**match_dict) - return "`{text} <{url}>`_".format(text=text, url=url) - class BootstrapBookmark: name = 'bootstrap' |