Skip to content

Commit

Permalink
Simplify test for host arg
Browse files Browse the repository at this point in the history
  • Loading branch information
lkubb committed Aug 18, 2024
1 parent 7d9b190 commit 3721ab2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,17 +328,14 @@ def docs_dev(session) -> None:
)

build_dir = pathlib.Path("docs", "_build", "html")

# Allow specifying sphinx-autobuild options, like --host.
args = ["--watch", "."] + session.posargs
for arg in args:
if arg.startswith("--host"):
break
else:
if not any(arg.startswith("--host") for arg in args):
# If the user is overriding the host to something other than localhost,
# it's likely they are rendering on a remote/headless system and don't
# want the browser to open.
args.append("--open-browser")

args += ["docs", str(build_dir)]

if build_dir.exists():
Expand Down

0 comments on commit 3721ab2

Please sign in to comment.