Skip to content

Commit a76ed28

Browse files
author
Lukas Puehringer
committed
build: lint 'verify_release' with tox
Enable tox to lint 'verify_release' script and fix: - whitespace - unused import (we only import here to see if the module is available for use in a subprocess) - unfound import (same as unused import) Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
1 parent a1a71c1 commit a76ed28

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ commands =
3939

4040
[testenv:lint]
4141
changedir = {toxinidir}
42-
lint_dirs = tuf examples tests
42+
lint_dirs = tuf examples tests verify_release
4343
commands =
4444
black --check --diff {[testenv:lint]lint_dirs}
4545
isort --check --diff {[testenv:lint]lint_dirs}

verify_release

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ from filecmp import dircmp
1717
from tempfile import TemporaryDirectory
1818

1919
try:
20+
import build as _ # type: ignore
2021
import requests
21-
import build
2222
except ImportError:
23-
print ("Error: verify_release requires modules 'requests' and 'build':")
24-
print (" pip install requests build")
25-
exit(1)
23+
print("Error: verify_release requires modules 'requests' and 'build':")
24+
print(" pip install requests build")
25+
sys.exit(1)
2626

2727
# Project variables
2828
# Note that only these project artifacts are supported:
@@ -128,7 +128,6 @@ def progress(s: str) -> None:
128128
def main() -> int:
129129
success = True
130130
with TemporaryDirectory() as build_dir:
131-
132131
progress("Building release")
133132
build_version = build(build_dir)
134133
finished(f"Built release {build_version}")

0 commit comments

Comments
 (0)