-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6937 from pradyunsg/use-nox
- Loading branch information
Showing
8 changed files
with
67 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
"""Release time helpers, executed using nox. | ||
""" | ||
|
||
import io | ||
import subprocess | ||
|
||
import nox | ||
|
||
|
||
def get_author_list(): | ||
"""Get the list of authors from Git commits. | ||
""" | ||
# subprocess because session.run doesn't give us stdout | ||
result = subprocess.run( | ||
["git", "log", "--use-mailmap", "--format=%aN <%aE>"], | ||
capture_output=True, | ||
encoding="utf-8", | ||
) | ||
|
||
# Create a unique list. | ||
authors = [] | ||
seen_authors = set() | ||
for author in result.stdout.splitlines(): | ||
author = author.strip() | ||
if author.lower() not in seen_authors: | ||
seen_authors.add(author.lower()) | ||
authors.append(author) | ||
|
||
# Sort our list of Authors by their case insensitive name | ||
return sorted(authors, key=lambda x: x.lower()) | ||
|
||
|
||
# ----------------------------------------------------------------------------- | ||
# Commands used during the release process | ||
# ----------------------------------------------------------------------------- | ||
@nox.session | ||
def generate_authors(session): | ||
# Get our list of authors | ||
session.log("Collecting author names") | ||
authors = get_author_list() | ||
|
||
# Write our authors to the AUTHORS file | ||
session.log("Writing AUTHORS") | ||
with io.open("AUTHORS.txt", "w", encoding="utf-8") as fp: | ||
fp.write(u"\n".join(authors)) | ||
fp.write(u"\n") | ||
|
||
|
||
@nox.session | ||
def generate_news(session): | ||
session.log("Generating NEWS") | ||
session.install("towncrier") | ||
|
||
# You can pass 2 possible arguments: --draft, --yes | ||
session.run("towncrier", *session.posargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import invoke | ||
|
||
from tools.automation import generate, vendoring | ||
from tools.automation import vendoring | ||
|
||
ns = invoke.Collection(generate, vendoring) | ||
ns = invoke.Collection(vendoring) |
This file was deleted.
Oops, something went wrong.