diff options
| author | Matt Iversen <teh.ivo@gmail.com> | 2016-01-20 04:58:52 +1100 |
|---|---|---|
| committer | Matt Iversen <teh.ivo@gmail.com> | 2016-01-20 04:58:52 +1100 |
| commit | f2abe039eaf0add3245ede11c488d20dc21affc3 (patch) | |
| tree | 1f713708f36131360ee494c4bf4fd2a15f5b4c65 | |
| parent | deb3f6a58d8fa2a9e40ab286d8eb6d75617462ba (diff) | |
| download | virtualenv-f2abe039eaf0add3245ede11c488d20dc21affc3.tar.gz | |
Shorten history in long_description to 2 releases
| -rw-r--r-- | setup.py | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -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(): |
