Skip to content

BUG: Don't clean docs and open browser in code_checks #55556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 11 additions & 2 deletions doc/make.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -349,6 +351,12 @@ def main():
action="store_true",
help="fail if warnings are raised",
)
argparser.add_argument(
"--no-browser",
help="Don't open browser",
default=False,
action="store_true",
)
args = argparser.parse_args()

if args.command not in cmds:
Expand All @@ -374,6 +382,7 @@ def main():
args.single,
args.verbosity,
args.warnings_are_errors,
args.no_browser,
)
return getattr(builder, args.command)()

Expand Down