10
10
import subprocess
11
11
import time
12
12
import datetime
13
+ from typing import Any
13
14
14
15
import invoke
15
- from invoke import task
16
+ from invoke . tasks import task
16
17
from dotenv import load_dotenv
17
18
18
19
19
- def using_buildx (c : any , binary : str ) -> bool :
20
+ def using_buildx (c : Any , binary : str ) -> bool :
20
21
"""Detect if docker buildx is being used
21
22
22
23
Args:
@@ -40,14 +41,14 @@ class ColourFormatter(logging.Formatter):
40
41
red = "\x1b [31;20m"
41
42
bold_red = "\x1b [31;1m"
42
43
reset = "\x1b [0m"
43
- format = "%(levelname)-8s %(message)s (%(filename)s:%(lineno)d)"
44
+ template = "%(levelname)-8s %(message)s (%(filename)s:%(lineno)d)"
44
45
45
46
FORMATS = {
46
- logging .DEBUG : grey + format + reset ,
47
- logging .INFO : grey + format + reset ,
48
- logging .WARNING : yellow + format + reset ,
49
- logging .ERROR : red + format + reset ,
50
- logging .CRITICAL : bold_red + format + reset ,
47
+ logging .DEBUG : grey + template + reset ,
48
+ logging .INFO : grey + template + reset ,
49
+ logging .WARNING : yellow + template + reset ,
50
+ logging .ERROR : red + template + reset ,
51
+ logging .CRITICAL : bold_red + template + reset ,
51
52
}
52
53
53
54
def format (self , record ):
@@ -397,8 +398,7 @@ def flake_finder(
397
398
398
399
if os .path .exists (outputdir ):
399
400
if not clean :
400
- # sys.exit(1)
401
- raise invoke .Exit (
401
+ raise invoke .exceptions .Exit (
402
402
(
403
403
"ERROR: Output directory already exists. "
404
404
f"Please use --clean if you want to remove it. dir={ outputdir } "
@@ -428,7 +428,7 @@ def flake_finder(
428
428
exclude = exclude ,
429
429
)
430
430
passed .append (i )
431
- except invoke .exceptions .Failure as ex :
431
+ except invoke .exceptions .Failure :
432
432
failed .append (i )
433
433
434
434
duration_sec = time .monotonic () - duration_start
0 commit comments