Auto generate AUTHORS file for glance.

Bug: 976267

Now that git commits are gated by CLA, we shouldn't enforce
committers to add an entry in AUTHORS file. The AUTHORS file
should be generated automatically, based on git commits.

This commit fixes the problem.

* Authors
  Remove this file. To be consistent with other projects,
  the new file AUTHORS is generated automatically.

* .gitignore
  Add AUTHORS file.

* glance/common/setup.py
  generate_authors(): New method to create AUTHORS file. If
  AUTHORS.in file exists, append it's content to AUTHORS file.

* setup.py
  Import the new method.
  local_sdist.run(): Generate AUTHORS file before creating the
  package.

* MANIFEST.in
  s/Authors/AUTHORS

* glance/tests/unit/test_misc.py
  AuthorsTestCase: Remove this class that test an entry in
  Authors file.
  parse_mailmap(), str_dict_replace(): Remove these methods.

Change-Id: If83c3fe9b2142342ac11cc019bc24926f52ee753
This commit is contained in:
Bhuvan Arumugam 2012-04-20 23:37:28 -07:00
parent c1053b233e
commit f4ce37b9c2
5 changed files with 4 additions and 118 deletions

1
.gitignore vendored
View File

@ -4,6 +4,7 @@
.glance-venv
.venv
.tox
AUTHORS
build
dist
glance.egg-info

71
Authors
View File

@ -1,71 +0,0 @@
Adam Gandelman <adam.gandelman@canonical.com>
Alex Meade <alex.meade@rackspace.com>
Andrew Hutchings <andrew@linuxjedi.co.uk>
Andrey Brindeyev <abrindeyev@griddynamics.com>
Bernhard M. Wiedemann <bwiedemann@suse.de>
Bhuvan Arumugam <bhuvan@apache.org>
Brian Lamar <brian.lamar@rackspace.com>
Brian Waldon <brian.waldon@rackspace.com>
Chris Behrens <cbehrens@codestud.com>
Christopher MacGown <chris@pistoncloud.com>
Chuck Short <chuck.short@canonical.com>
Cory Wright <corywright@gmail.com>
Dan Prince <dprince@redhat.com>
Dean Troyer <dtroyer@gmail.com>
Derek Higgins <derekh@redhat.com>
Donal Lafferty <donal.lafferty@citrix.com>
Eldar Nugaev <enugaev@griddynamics.com>
Eoghan Glynn <eglynn@redhat.com>
Ewan Mellor <ewan.mellor@citrix.com>
Gabriel Hurley <gabriel@strikeawe.com>
Hengqing Hu <hudayou@hotmail.com>
Ionuț Arțăriși <iartarisi@suse.cz>
Isaku Yamahata <yamahata@valinux.co.jp>
J. Daniel Schmidt <jdsn@suse.de>
Jason Koelker <jason@koelker.net>
Jay Pipes <jaypipes@gmail.com>
James E. Blair <jeblair@hp.com>
Jesse Andrews <anotherjesse@gmail.com>
Jinwoo 'Joseph' Suh <jsuh@isi.edu>
Joe Gordon <jogo@cloudscaling.com>
Johannes Erdfelt <johannes.erdfelt@rackspace.com>
Josh Durgin <josh.durgin@dreamhost.com>
Josh Kearney <josh@jk0.org>
Juerg Haefliger <juerg.haefliger@hp.com>
Justin Santa Barbara <justin@fathomdb.com>
Justin Shepherd <jshepher@rackspace.com>
Ken Pepple <ken.pepple@gmail.com>
Ken Thomas <krt@yahoo-inc.com>
Kevin L. Mitchell <kevin.mitchell@rackspace.com>
Lorin Hochstein <lorin@nimbisservices.com>
Major Hayden <major@mhtx.net>
Mark McLoughlin <markmc@redhat.com>
Mark Washenberger <mark.washenberger@rackspace.com>
Maru Newby <mnewby@internap.com>
Matt Dietz <matt.dietz@rackspace.com>
Matthias Schmitz <matthias@sigxcpu.org>
Mike Lundy <mike@pistoncloud.com>
Monty Taylor <mordred@inaugust.com>
Pádraig Brady <P@draigBrady.com>
Paul Bourke <paul-david.bourke@hp.com>
Paul McMillan <paul.mcmillan@nebula.com>
Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Peng Yong <ppyy@pubyun.com>
Pete Zaitcev <zaitcev@kotori.zaitcev.us>
Rick Clark <rick@openstack.org>
Rick Harris <rconradharris@gmail.com>
Reynolds Chin <benzwt@gmail.com>
Russell Bryant <rbryant@redhat.com>
Sam Morrison <sorrison@gmail.com>
Soren Hansen <soren.hansen@rackspace.com>
Stuart McLaren <stuart.mclaren@hp.com>
Taku Fukushima <tfukushima@dcl.info.waseda.ac.jp>
Thierry Carrez <thierry@openstack.org>
Tom Hancock <tom.hancock@hp.com>
Unmesh Gurjar <unmesh.gurjar@vertex.co.in>
Wayne A. Walls <wayne.walls@rackspace.com>
William Wolf <throughnothing@gmail.com>
Vishvananda Ishaya <vishvananda@gmail.com>
Yaguang Tang <heut2008@gmail.com>
Yuriy Taraday <yorik.sar@gmail.com>
Zhongyue Luo <lzyeval@gmail.com>

View File

@ -1,7 +1,7 @@
include run_tests.sh ChangeLog
include README.rst builddeb.sh
include MANIFEST.in pylintrc
include Authors
include AUTHORS
include run_tests.py
include HACKING.rst
include LICENSE

View File

@ -26,52 +26,6 @@ from glance.common import exception
from glance.common import utils
def parse_mailmap(mailmap='.mailmap'):
mapping = {}
if os.path.exists(mailmap):
fp = open(mailmap, 'r')
for l in fp:
l = l.strip()
if not l.startswith('#') and ' ' in l:
canonical_email, alias = l.split(' ')
mapping[alias] = canonical_email
return mapping
def str_dict_replace(s, mapping):
for s1, s2 in mapping.iteritems():
s = s.replace(s1, s2)
return s
class AuthorsTestCase(unittest.TestCase):
def test_authors_up_to_date(self):
topdir = os.path.normpath(os.path.dirname(__file__) + '/../../..')
contributors = set()
missing = set()
authors_file = open(os.path.join(topdir, 'Authors'), 'r').read()
if os.path.exists(os.path.join(topdir, '.git')):
mailmap = parse_mailmap(os.path.join(topdir, '.mailmap'))
for email in commands.getoutput('git log --format=%ae').split():
if not email:
continue
if "jenkins" in email and "openstack.org" in email:
continue
email = '<' + email + '>'
contributors.add(str_dict_replace(email, mailmap))
for contributor in contributors:
if contributor == 'glance-core':
continue
if not contributor in authors_file:
missing.add(contributor)
self.assertTrue(len(missing) == 0,
'%r not listed in Authors' % missing)
class UtilsTestCase(unittest.TestCase):
def test_bool_from_string(self):

View File

@ -21,6 +21,7 @@ import subprocess
from setuptools import setup, find_packages
from setuptools.command.sdist import sdist
from glance.openstack.common.setup import generate_authors
from glance.openstack.common.setup import parse_requirements
from glance.openstack.common.setup import parse_dependency_links
@ -65,6 +66,7 @@ class local_sdist(sdist):
changelog = log_cmd.communicate()[0]
with open("ChangeLog", "w") as changelog_file:
changelog_file.write(changelog)
generate_authors()
sdist.run(self)
cmdclass = {'sdist': local_sdist}