Skip to content

Commit 6e4e79e

Browse files
committed
Reuse target_build_dir in the build session
1 parent 36b1c37 commit 6e4e79e

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

noxfile.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
def build(session, autobuild=False):
1212
session.install("-r", "requirements.txt")
1313

14-
shutil.rmtree("build", ignore_errors=True)
14+
target_build_dir = "build"
15+
16+
shutil.rmtree(target_build_dir, ignore_errors=True)
1517

1618
if autobuild:
1719
command = "sphinx-autobuild"
@@ -20,7 +22,13 @@ def build(session, autobuild=False):
2022
command = "sphinx-build"
2123
extra_args = ()
2224

23-
session.run(command, *extra_args, "-W", "-b", "html", "source", "build")
25+
session.run(
26+
command, *extra_args,
27+
"-b", "html", # use HTML builder
28+
"-W", # Treat warnings as errors.
29+
"source", # where the rst files are located
30+
target_build_dir, # where to put the html output
31+
)
2432

2533

2634
@nox.session(py="3")

0 commit comments

Comments
 (0)