From 13c4f3cea42552f294d4e62b4d2b44e0cab637d5 Mon Sep 17 00:00:00 2001 From: emmanuelle Date: Fri, 25 Dec 2015 18:27:08 +0100 Subject: [PATCH] Execute contribs.py in travis_script.sh Added tag of previous release Only recent commits for contribs.py so that Travis is happy Do not execute contribs.py for Python 2.6 Do not execute contribs.py for python 2.6 --- doc/release/contribs.py | 59 ++++++++++++++++++++++------------------- tools/travis_script.sh | 4 +++ 2 files changed, 35 insertions(+), 28 deletions(-) diff --git a/doc/release/contribs.py b/doc/release/contribs.py index 18a108e3..6fcc0d87 100755 --- a/doc/release/contribs.py +++ b/doc/release/contribs.py @@ -10,42 +10,45 @@ if len(sys.argv) != 2: tag = sys.argv[1] -def call(cmd): - return subprocess.check_output(shlex.split(cmd), universal_newlines=True).split('\n') -tag_date = call("git show --format='%%ci' %s" % tag)[0] -print("Release %s was on %s\n" % (tag, tag_date)) +if not sys.version_info[:2] == (2, 6): -merges = call("git log --since='%s' --merges --format='>>>%%B' --reverse" % tag_date) -merges = [m for m in merges if m.strip()] -merges = '\n'.join(merges).split('>>>') -merges = [m.split('\n')[:2] for m in merges] -merges = [m for m in merges if len(m) == 2 and m[1].strip()] + def call(cmd): + return subprocess.check_output(shlex.split(cmd), universal_newlines=True).split('\n') -num_commits = call("git rev-list %s..HEAD --count" % tag)[0] -print("A total of %s changes have been committed.\n" % num_commits) + tag_date = call("git show --format='%%ci' %s" % tag)[0] + print("Release %s was on %s\n" % (tag, tag_date)) -print("It contained the following %d merges:\n" % len(merges)) -for (merge, message) in merges: - if merge.startswith('Merge pull request #'): - PR = ' (%s)' % merge.split()[3] - else: - PR = '' + merges = call("git log --since='%s' --merges --format='>>>%%B' --reverse" % tag_date) + merges = [m for m in merges if m.strip()] + merges = '\n'.join(merges).split('>>>') + merges = [m.split('\n')[:2] for m in merges] + merges = [m for m in merges if len(m) == 2 and m[1].strip()] - print('- ' + message + PR) + num_commits = call("git rev-list %s..HEAD --count" % tag)[0] + print("A total of %s changes have been committed.\n" % num_commits) + + print("It contained the following %d merges:\n" % len(merges)) + for (merge, message) in merges: + if merge.startswith('Merge pull request #'): + PR = ' (%s)' % merge.split()[3] + else: + PR = '' + + print('- ' + message + PR) -print("\nMade by the following committers [alphabetical by last name]:\n") + print("\nMade by the following committers [alphabetical by last name]:\n") -authors = call("git log --since='%s' --format=%%aN" % tag_date) -authors = [a.strip() for a in authors if a.strip()] + authors = call("git log --since='%s' --format=%%aN" % tag_date) + authors = [a.strip() for a in authors if a.strip()] -def key(author): - author = [v for v in author.split() if v[0] in string.ascii_letters] - if len(author) > 0: - return author[-1] + def key(author): + author = [v for v in author.split() if v[0] in string.ascii_letters] + if len(author) > 0: + return author[-1] -authors = sorted(set(authors), key=key) + authors = sorted(set(authors), key=key) -for a in authors: - print('- ' + a) + for a in authors: + print('- ' + a) diff --git a/tools/travis_script.sh b/tools/travis_script.sh index 4e40e997..e08fd689 100755 --- a/tools/travis_script.sh +++ b/tools/travis_script.sh @@ -111,3 +111,7 @@ fi nosetests $TEST_ARGS section_end "Test.with.optional.dependencies" + +section "Prepare.release" +doc/release/contribs.py HEAD~10 +section_end "Prepare.release"