Skip to content

Commit bd5455e

Browse files
authored
BUG: Don't clean docs and open browser in code_checks (#55556)
* BUG: Don't clean docs and open browser in code_checks * fixup
1 parent 746e5ee commit bd5455e

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

ci/code_checks.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,8 @@ fi
176176

177177
### SINGLE-PAGE DOCS ###
178178
if [[ -z "$CHECK" || "$CHECK" == "single-docs" ]]; then
179-
python doc/make.py --warnings-are-errors --single pandas.Series.value_counts
180-
python doc/make.py --warnings-are-errors --single pandas.Series.str.split
181-
python doc/make.py clean
179+
python doc/make.py --warnings-are-errors --no-browser --single pandas.Series.value_counts
180+
python doc/make.py --warnings-are-errors --no-browser --single pandas.Series.str.split
182181
fi
183182

184183
exit $RET

doc/make.py

+11-2
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@ def __init__(
4545
single_doc=None,
4646
verbosity=0,
4747
warnings_are_errors=False,
48+
no_browser=False,
4849
) -> None:
4950
self.num_jobs = num_jobs
5051
self.include_api = include_api
5152
self.whatsnew = whatsnew
5253
self.verbosity = verbosity
5354
self.warnings_are_errors = warnings_are_errors
55+
self.no_browser = no_browser
5456

5557
if single_doc:
5658
single_doc = self._process_single_doc(single_doc)
@@ -234,11 +236,11 @@ def html(self):
234236
os.remove(zip_fname)
235237

236238
if ret_code == 0:
237-
if self.single_doc_html is not None:
239+
if self.single_doc_html is not None and not self.no_browser:
238240
self._open_browser(self.single_doc_html)
239241
else:
240242
self._add_redirects()
241-
if self.whatsnew:
243+
if self.whatsnew and not self.no_browser:
242244
self._open_browser(os.path.join("whatsnew", "index.html"))
243245

244246
return ret_code
@@ -349,6 +351,12 @@ def main():
349351
action="store_true",
350352
help="fail if warnings are raised",
351353
)
354+
argparser.add_argument(
355+
"--no-browser",
356+
help="Don't open browser",
357+
default=False,
358+
action="store_true",
359+
)
352360
args = argparser.parse_args()
353361

354362
if args.command not in cmds:
@@ -374,6 +382,7 @@ def main():
374382
args.single,
375383
args.verbosity,
376384
args.warnings_are_errors,
385+
args.no_browser,
377386
)
378387
return getattr(builder, args.command)()
379388

0 commit comments

Comments
 (0)