From 3721ab243202f4d30aab850d0de29401a6163ef8 Mon Sep 17 00:00:00 2001 From: jeanluc Date: Sun, 18 Aug 2024 10:29:02 +0200 Subject: [PATCH] Simplify test for host arg --- noxfile.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/noxfile.py b/noxfile.py index c0a2c60..0757f53 100755 --- a/noxfile.py +++ b/noxfile.py @@ -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():