summaryrefslogtreecommitdiffstats
path: root/nova/openstack
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2012-07-13 12:07:33 -0400
committerDan Prince <dprince@redhat.com>2012-07-13 12:09:52 -0400
commit12a89225e30d2b31854be387b78cd60a15446163 (patch)
tree5d59916a3400c0cc4fd2dfb5f6adfedb3ee7002c /nova/openstack
parent03de59d976e1c2e821ebfa2ee8933083c92a27e6 (diff)
downloadnova-12a89225e30d2b31854be387b78cd60a15446163.tar.gz
nova-12a89225e30d2b31854be387b78cd60a15446163.tar.xz
nova-12a89225e30d2b31854be387b78cd60a15446163.zip
Add SKIP_WRITE_GIT_CHANGELOG to setup.py.
Sync with latest setup.py from openstack-common which adds options to SKIP_WRITE_GIT_CHANGELOG and SKIP_GENERATE_AUTHORS. If you set SKIP_WRITE_GIT_CHANGELOG in your environment it will speed up sdist creation by 10-20 seconds which also helps make tox run faster (because it runs sdist). Change-Id: I5da708d2e9547d5e554cf49ecfcf39591de6a4e5
Diffstat (limited to 'nova/openstack')
-rw-r--r--nova/openstack/common/setup.py42
1 files changed, 25 insertions, 17 deletions
diff --git a/nova/openstack/common/setup.py b/nova/openstack/common/setup.py
index 2be72e61a..59f255d0c 100644
--- a/nova/openstack/common/setup.py
+++ b/nova/openstack/common/setup.py
@@ -178,12 +178,16 @@ def _get_git_post_version():
def write_git_changelog():
"""Write a changelog based on the git changelog."""
- if os.path.isdir('.git'):
- git_log_cmd = 'git log --stat'
- changelog = _run_shell_command(git_log_cmd)
- mailmap = parse_mailmap()
- with open("ChangeLog", "w") as changelog_file:
- changelog_file.write(canonicalize_emails(changelog, mailmap))
+ new_changelog = 'ChangeLog'
+ if not os.getenv('SKIP_WRITE_GIT_CHANGELOG'):
+ if os.path.isdir('.git'):
+ git_log_cmd = 'git log --stat'
+ changelog = _run_shell_command(git_log_cmd)
+ mailmap = parse_mailmap()
+ with open(new_changelog, "w") as changelog_file:
+ changelog_file.write(canonicalize_emails(changelog, mailmap))
+ else:
+ open(new_changelog, 'w').close()
def generate_authors():
@@ -191,17 +195,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