mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2024-10-26 07:55:06 +03:00
setup: simplify authors list generation
Use a set to collect the authors from the git output with no duplicates, then sort the resulting set, and apply the wanted indentation. This method is more Pythonic, using a set to avoid duplicates; applying the indentation after the sorting makes the sorting slightly faster. Signed-off-by: Pino Toscano <ptoscano@redhat.com>
This commit is contained in:
parent
41363417b7
commit
c4ede87284
10
setup.py
10
setup.py
@ -199,15 +199,11 @@ class my_sdist(sdist):
|
||||
|
||||
def gen_authors(self):
|
||||
|
||||
authors = []
|
||||
cmd = ["git", "log", "--pretty=format:%aN <%aE>"]
|
||||
output = subprocess.check_output(cmd, universal_newlines=True)
|
||||
for line in output.splitlines():
|
||||
line = " " + line.strip()
|
||||
if line not in authors:
|
||||
authors.append(line)
|
||||
|
||||
authors.sort(key=str.lower)
|
||||
git_authors = {line.strip() for line in output.splitlines()}
|
||||
authors = sorted(git_authors, key=str.lower)
|
||||
authors = [" " + author for author in authors]
|
||||
self._gen_from_in("AUTHORS.in",
|
||||
"AUTHORS",
|
||||
"@AUTHORS@",
|
||||
|
Loading…
Reference in New Issue
Block a user