From db6d5f7ac474fa0605213514e793f98a0157a2ab Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 5 Apr 2013 17:14:51 -0400 Subject: Bumped to 0.6.37 in preparation for next release. --HG-- branch : distribute extra : rebase_source : a59fcbbf5ca73fb41958d42d33d3de299ad9ae7c --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 607954d0..a3a658f8 100755 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ exec(init_file.read(), d) init_file.close() SETUP_COMMANDS = d['__all__'] -VERSION = "0.6.36" +VERSION = "0.6.37" from setuptools import setup, find_packages from setuptools.command.build_py import build_py as _build_py -- cgit v1.2.3 From a34e56cef2e2cb2aea3d4ff5b532949d426e3b97 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 4 May 2013 22:10:00 -0400 Subject: Bumped to 0.6.38 in preparation for next release. --HG-- branch : distribute extra : rebase_source : cf2ffa52b8e0cf1403b4e8ca23921a4cda51ba5b --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index a3a658f8..4ee8a08f 100755 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ exec(init_file.read(), d) init_file.close() SETUP_COMMANDS = d['__all__'] -VERSION = "0.6.37" +VERSION = "0.6.38" from setuptools import setup, find_packages from setuptools.command.build_py import build_py as _build_py -- cgit v1.2.3 From ce9cbd6577c6ab67d70ea292468fae7f4d3add26 Mon Sep 17 00:00:00 2001 From: "guy@guyr-air.infinidat.com" Date: Sun, 5 May 2013 11:16:24 +0300 Subject: Issue #371: instructing setup.py to install the xml files in setuptools.command --HG-- branch : distribute extra : rebase_source : 3d0a26ca9a25c2e7467c6ffb515d0cb92f2f8173 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 4ee8a08f..83612ebc 100755 --- a/setup.py +++ b/setup.py @@ -170,7 +170,7 @@ dist = setup( test_suite = 'setuptools.tests', src_root = src_root, packages = find_packages(), - package_data = {'setuptools':['*.exe']}, + package_data = {'setuptools':['*.exe'], 'setuptools.command':['*.xml']}, py_modules = ['pkg_resources', 'easy_install', 'site'], -- cgit v1.2.3 From 878a81c62061ab506ed1874d541cbeb714fe06fe Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 5 May 2013 08:45:43 -0400 Subject: Bumped to 0.6.39 in preparation for next release. --HG-- branch : distribute extra : rebase_source : 3e627b0d100b8ae32e8dc995f2da0003bbd9c605 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 83612ebc..4f56fe15 100755 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ exec(init_file.read(), d) init_file.close() SETUP_COMMANDS = d['__all__'] -VERSION = "0.6.38" +VERSION = "0.6.39" from setuptools import setup, find_packages from setuptools.command.build_py import build_py as _build_py -- cgit v1.2.3 From a0f5752e58db3a0eaaa68b22f0b1f878e824a117 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 5 May 2013 09:08:11 -0400 Subject: Extract another function for constructing linkified changes --HG-- branch : distribute extra : rebase_source : e764f523fff11bf7caa7e5183c7300afeee75dab --- setup.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 4f56fe15..bc8137c8 100755 --- a/setup.py +++ b/setup.py @@ -133,15 +133,18 @@ if _being_installed(): from distribute_setup import _before_install _before_install() -# return contents of reStructureText file with linked issue references def _linkified(rst_path): - bitroot = 'http://bitbucket.org/tarek/distribute' - revision = re.compile(r'\b(issue\s+#?\d+)\b', re.M | re.I) - + "return contents of reStructureText file with linked issue references" rst_file = open(rst_path) rst_content = rst_file.read() rst_file.close() + return _linkified_text(rst_content) + +def _linkified_text(rst_content): + bitroot = 'http://bitbucket.org/tarek/distribute' + revision = re.compile(r'\b(issue\s+#?\d+)\b', re.M | re.I) + anchors = revision.findall(rst_content) # ['Issue #43', ...] anchors = sorted(set(anchors)) rst_content = revision.sub(r'`\1`_', rst_content) -- cgit v1.2.3 From b78ecd63d5c206a5cd0b065656a4493ffe496fe5 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 5 May 2013 09:36:55 -0400 Subject: Fix linkification of CHANGES.txt (broken due to buildout issue reference) --HG-- branch : distribute extra : rebase_source : a331dda293481f2cf121956070f94bfe6c9e0a0c --- setup.py | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index bc8137c8..1db770e9 100755 --- a/setup.py +++ b/setup.py @@ -142,12 +142,24 @@ def _linkified(rst_path): return _linkified_text(rst_content) def _linkified_text(rst_content): - bitroot = 'http://bitbucket.org/tarek/distribute' - revision = re.compile(r'\b(issue\s+#?\d+)\b', re.M | re.I) + # first identify any existing HREFs so they're not changed + HREF_pattern = re.compile('`.*?`_', re.MULTILINE | re.DOTALL) + + # split on the HREF pattern, returning the parts to be linkified + plain_text_parts = HREF_pattern.split(rst_content) + anchors = [] + linkified_parts = [_linkified_part(part, anchors) + for part in plain_text_parts] + pairs = itertools.izip_longest( + linkified_parts, + HREF_pattern.findall(rst_content), + fillvalue='', + ) + rst_content = ''.join(flatten(pairs)) + + anchors = sorted(anchors) - anchors = revision.findall(rst_content) # ['Issue #43', ...] - anchors = sorted(set(anchors)) - rst_content = revision.sub(r'`\1`_', rst_content) + bitroot = 'http://bitbucket.org/tarek/distribute' rst_content += "\n" for x in anchors: issue = re.findall(r'\d+', x)[0] @@ -155,6 +167,21 @@ def _linkified_text(rst_content): rst_content += "\n" return rst_content +import itertools +def flatten(listOfLists): + "Flatten one level of nesting" + return itertools.chain.from_iterable(listOfLists) + + +def _linkified_part(text, anchors): + """ + Linkify a part and collect any anchors generated + """ + revision = re.compile(r'\b(issue\s+#?\d+)\b', re.M | re.I) + + anchors.extend(revision.findall(text)) # ['Issue #43', ...] + return revision.sub(r'`\1`_', text) + readme_file = open('README.txt') long_description = readme_file.read() + _linkified('CHANGES.txt') readme_file.close() -- cgit v1.2.3 From 92952a515bca3813de6d5e27638a8e7fcd0117a7 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 5 May 2013 09:50:36 -0400 Subject: Moved link generation routine from setup.py to release.py. The new routine requires Python 2.6 for izip_longest and chain.from_iterable, so it's not suitable for setup.py. Also, there's no reason that every installer needs to compute the links - they can be resolved in advance during the release process. --HG-- branch : distribute extra : rebase_source : 9f4af99f70fdfa00290be2261a921af9a76ba597 --- setup.py | 53 +++-------------------------------------------------- 1 file changed, 3 insertions(+), 50 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 1db770e9..e79fb659 100755 --- a/setup.py +++ b/setup.py @@ -133,58 +133,11 @@ if _being_installed(): from distribute_setup import _before_install _before_install() -def _linkified(rst_path): - "return contents of reStructureText file with linked issue references" - rst_file = open(rst_path) - rst_content = rst_file.read() - rst_file.close() - - return _linkified_text(rst_content) - -def _linkified_text(rst_content): - # first identify any existing HREFs so they're not changed - HREF_pattern = re.compile('`.*?`_', re.MULTILINE | re.DOTALL) - - # split on the HREF pattern, returning the parts to be linkified - plain_text_parts = HREF_pattern.split(rst_content) - anchors = [] - linkified_parts = [_linkified_part(part, anchors) - for part in plain_text_parts] - pairs = itertools.izip_longest( - linkified_parts, - HREF_pattern.findall(rst_content), - fillvalue='', - ) - rst_content = ''.join(flatten(pairs)) - - anchors = sorted(anchors) - - bitroot = 'http://bitbucket.org/tarek/distribute' - rst_content += "\n" - for x in anchors: - issue = re.findall(r'\d+', x)[0] - rst_content += '.. _`%s`: %s/issue/%s\n' % (x, bitroot, issue) - rst_content += "\n" - return rst_content - -import itertools -def flatten(listOfLists): - "Flatten one level of nesting" - return itertools.chain.from_iterable(listOfLists) - - -def _linkified_part(text, anchors): - """ - Linkify a part and collect any anchors generated - """ - revision = re.compile(r'\b(issue\s+#?\d+)\b', re.M | re.I) - - anchors.extend(revision.findall(text)) # ['Issue #43', ...] - return revision.sub(r'`\1`_', text) - readme_file = open('README.txt') -long_description = readme_file.read() + _linkified('CHANGES.txt') +changes_file = open('CHANGES (links).txt') +long_description = readme_file.read() + changes_file.read() readme_file.close() +changes_file.close() dist = setup( name="distribute", -- cgit v1.2.3 From a938092e7b189337cdd25c101c2e8fc984433eff Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 5 May 2013 19:59:39 -0400 Subject: Allow the setup script to run even if the linked changelog hasn't been generated --HG-- branch : distribute extra : rebase_source : e94ca350b1a601b75ff6ae786dcdabbe517877c3 --- setup.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index e79fb659..eeec3153 100755 --- a/setup.py +++ b/setup.py @@ -134,7 +134,12 @@ if _being_installed(): _before_install() readme_file = open('README.txt') -changes_file = open('CHANGES (links).txt') +# the release script adds hyperlinks to issues +if os.path.exists('CHANGES (links).txt'): + changes_file = open('CHANGES (links).txt') +else: + # but if the release script has not run, fall back to the source file + changes_file = open('CHANGES.txt') long_description = readme_file.read() + changes_file.read() readme_file.close() changes_file.close() -- cgit v1.2.3 From 3ab400cd437e4839cb8d4cc70dd5889a5b0c7469 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 12 May 2013 14:13:13 -0400 Subject: Bumped to 0.6.40 in preparation for next release. --HG-- branch : distribute extra : rebase_source : 355bf27e11fdf906de100c2a47145d44fac082cc --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index eeec3153..9d15793c 100755 --- a/setup.py +++ b/setup.py @@ -46,7 +46,7 @@ exec(init_file.read(), d) init_file.close() SETUP_COMMANDS = d['__all__'] -VERSION = "0.6.39" +VERSION = "0.6.40" from setuptools import setup, find_packages from setuptools.command.build_py import build_py as _build_py -- cgit v1.2.3