@@ -55,6 +55,7 @@ def check_links(ignore_glob, ignore_links, cache_file, links_expire):
55
55
cmd = f"{ python } -m pytest --noconftest --check-links --check-links-cache "
56
56
cmd += f"--check-links-cache-expire-after { links_expire } "
57
57
cmd += "--disable-warnings --quiet "
58
+ cmd += "-raXs "
58
59
cmd += f"--check-links-cache-name { cache_dir } /check-release-links "
59
60
# do not run doctests, since they might depend on other state.
60
61
cmd += "-p no:doctest "
@@ -84,14 +85,27 @@ def check_links(ignore_glob, ignore_links, cache_file, links_expire):
84
85
matched = glob (f"**/*{ ext } " , recursive = True )
85
86
files .extend (m for m in matched if not m in ignored and "node_modules" not in m )
86
87
88
+ util .log ("Checking files with options:" )
89
+ util .log (cmd )
90
+
91
+ fails = 0
87
92
for f in files :
88
93
file_cmd = cmd + f' "{ f } "'
89
94
try :
90
- util .run (file_cmd , shell = False )
95
+ util .log (f"\n C{ f } ..." )
96
+ util .run (file_cmd , shell = False , echo = False )
91
97
except Exception as e :
92
98
# Return code 5 means no tests were run (no links found)
93
99
if e .returncode != 5 :
94
- util .run (file_cmd + " --lf" , shell = False )
100
+ try :
101
+ util .log (f"{ f } (second attempt)..." )
102
+ util .run (file_cmd + " --lf" , shell = False , echo = False )
103
+ except Exception :
104
+ fails += 1
105
+ if fails == 3 :
106
+ raise RuntimeError ("Found three failed links, bailing" )
107
+ if fails :
108
+ raise RuntimeError (f"Encountered failures in { fails } file(s)" )
95
109
96
110
97
111
def draft_changelog (
0 commit comments