From 6682ed08f25474f764ce9cb884716fdbf43512ec Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 16 Oct 2023 23:38:53 -0400 Subject: [PATCH 1/2] BUG: Don't clean docs and open browser in code_checks --- ci/code_checks.sh | 5 ++--- doc/make.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 6caa39ae42926..e91629744463f 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -176,9 +176,8 @@ fi ### SINGLE-PAGE DOCS ### if [[ -z "$CHECK" || "$CHECK" == "single-docs" ]]; then - python doc/make.py --warnings-are-errors --single pandas.Series.value_counts - python doc/make.py --warnings-are-errors --single pandas.Series.str.split - python doc/make.py clean + python doc/make.py --warnings-are-errors --no-browser --single pandas.Series.value_counts + python doc/make.py --warnings-are-errors --no-browser --single pandas.Series.str.split fi exit $RET diff --git a/doc/make.py b/doc/make.py index 23b18d69acc04..72706b85f84c2 100755 --- a/doc/make.py +++ b/doc/make.py @@ -45,12 +45,14 @@ def __init__( single_doc=None, verbosity=0, warnings_are_errors=False, + no_browser=False, ) -> None: self.num_jobs = num_jobs self.include_api = include_api self.whatsnew = whatsnew self.verbosity = verbosity self.warnings_are_errors = warnings_are_errors + self.no_browser = no_browser if single_doc: single_doc = self._process_single_doc(single_doc) @@ -234,11 +236,11 @@ def html(self): os.remove(zip_fname) if ret_code == 0: - if self.single_doc_html is not None: + if self.single_doc_html is not None and not self.no_browser: self._open_browser(self.single_doc_html) else: self._add_redirects() - if self.whatsnew: + if self.whatsnew and not self.no_browser: self._open_browser(os.path.join("whatsnew", "index.html")) return ret_code @@ -349,6 +351,9 @@ def main(): action="store_true", help="fail if warnings are raised", ) + argparser.add_argument( + "--no-browser", help="Don't open browser", action="store_true" + ) args = argparser.parse_args() if args.command not in cmds: @@ -374,6 +379,7 @@ def main(): args.single, args.verbosity, args.warnings_are_errors, + args.no_browser, ) return getattr(builder, args.command)() From c83d3468f27016bdc8de0f3c356392bbe7b20b1f Mon Sep 17 00:00:00 2001 From: richard Date: Mon, 16 Oct 2023 23:42:40 -0400 Subject: [PATCH 2/2] fixup --- doc/make.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/make.py b/doc/make.py index 72706b85f84c2..dfa8ae6c1e34c 100755 --- a/doc/make.py +++ b/doc/make.py @@ -352,7 +352,10 @@ def main(): help="fail if warnings are raised", ) argparser.add_argument( - "--no-browser", help="Don't open browser", action="store_true" + "--no-browser", + help="Don't open browser", + default=False, + action="store_true", ) args = argparser.parse_args()