summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Iversen <teh.ivo@gmail.com>2016-01-20 04:58:52 +1100
committerMatt Iversen <teh.ivo@gmail.com>2016-01-20 04:58:52 +1100
commitf2abe039eaf0add3245ede11c488d20dc21affc3 (patch)
tree1f713708f36131360ee494c4bf4fd2a15f5b4c65
parentdeb3f6a58d8fa2a9e40ab286d8eb6d75617462ba (diff)
downloadvirtualenv-f2abe039eaf0add3245ede11c488d20dc21affc3.tar.gz
Shorten history in long_description to 2 releases
-rw-r--r--setup.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/setup.py b/setup.py
index 3f40f01..fc71f5a 100644
--- a/setup.py
+++ b/setup.py
@@ -61,10 +61,23 @@ long_description = read_file('docs', 'index.rst')
long_description = long_description.strip().split('split here', 1)[0]
# Add release history
changes = read_file('docs', 'changes.rst')
+# Only report last two releases for brevity
+releases_found = 0
+change_lines = []
+for line in changes.splitlines():
+ change_lines.append(line)
+ if line.startswith('--------------'):
+ releases_found += 1
+ if releases_found > 2:
+ break
+
+changes = '\n'.join(change_lines[:-2]) + '\n'
+changes += '`Full Changelog <https://virtualenv.pypa.io/en/latest/changes.html>`_.'
# Replace issue/pull directives
changes = re.sub(r':pull:`(\d+)`', r'PR #\1', changes)
changes = re.sub(r':issue:`(\d+)`', r'#\1', changes)
-long_description += "\n\n" + changes
+
+long_description += '\n\n' + changes
def get_version():