From 1fc2abc1726e4e233b4ff5fb9dff415acd8b9a4b Mon Sep 17 00:00:00 2001 From: Dan Prince Date: Fri, 13 Jul 2012 09:49:00 -0400 Subject: Add SKIP_GENERATE_AUTHORS option to setup.py Updates the generate_authors function in setup.py so that it will skip generation of the authors file if the SKIP_GENERATE_AUTHORS env variable is set. Authors doesn't currently take that long to generate but having the option to explicitly skip it (regardless of whether .git is there) seems like a good addition. Change-Id: Ie18064d2450cecc86f18d0b10e1ce473253d1a51 --- openstack/common/setup.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'openstack') diff --git a/openstack/common/setup.py b/openstack/common/setup.py index 2be72e6..cd4b97b 100644 --- a/openstack/common/setup.py +++ b/openstack/common/setup.py @@ -191,17 +191,21 @@ def generate_authors(): jenkins_email = 'jenkins@review.openstack.org' old_authors = 'AUTHORS.in' new_authors = 'AUTHORS' - if os.path.isdir('.git'): - # don't include jenkins email address in AUTHORS file - git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | " - "grep -v " + jenkins_email) - changelog = _run_shell_command(git_log_cmd) - mailmap = parse_mailmap() - with open(new_authors, 'w') as new_authors_fh: - new_authors_fh.write(canonicalize_emails(changelog, mailmap)) - if os.path.exists(old_authors): - with open(old_authors, "r") as old_authors_fh: - new_authors_fh.write('\n' + old_authors_fh.read()) + if not os.getenv('SKIP_GENERATE_AUTHORS'): + if os.path.isdir('.git'): + # don't include jenkins email address in AUTHORS file + git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | " + "grep -v " + jenkins_email) + changelog = _run_shell_command(git_log_cmd) + mailmap = parse_mailmap() + with open(new_authors, 'w') as new_authors_fh: + new_authors_fh.write(canonicalize_emails(changelog, mailmap)) + if os.path.exists(old_authors): + with open(old_authors, "r") as old_authors_fh: + new_authors_fh.write('\n' + old_authors_fh.read()) + else: + open(new_authors, 'w').close() + _rst_template = """%(heading)s %(underline)s -- cgit