Skip to content

Commit 43c451f

Browse files
authored
Merge pull request #1365 from pradyunsg/use-shared-cache-for-doctrees
Use a shared cache directory for Sphinx builds across nox sessions
2 parents 9d06acf + 5020425 commit 43c451f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

noxfile.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
# http://creativecommons.org/licenses/by-sa/3.0.
55

66
import shutil
7-
import nox
87

8+
import nox
99

1010
nox.options.sessions = []
1111

@@ -20,7 +20,7 @@ def translation(session):
2020
session.run(
2121
"sphinx-build",
2222
"-b", "gettext", # build gettext-style message catalogs (.pot file)
23-
"-d", ".nox/.doctrees/", # path to put the cache
23+
"-d", session.cache_dir / ".doctrees", # path to put the cache
2424
"source/", # where the rst files are located
2525
target_dir, # where to put the .pot file
2626
)
@@ -52,6 +52,7 @@ def build(session, autobuild=False):
5252
command, *extra_args,
5353
"-j", "auto", # parallelize the build
5454
"-b", "html", # use HTML builder
55+
"-d", session.cache_dir / ".doctrees", # path to put the cache
5556
"-n", # nitpicky warn about all missing references
5657
"-W", # Treat warnings as errors.
5758
*session.posargs,
@@ -78,6 +79,7 @@ def linkcheck(session):
7879
session.run(
7980
"sphinx-build",
8081
"-b", "linkcheck", # use linkcheck builder
82+
"-d", session.cache_dir / ".doctrees", # path to put the cache
8183
"--color",
8284
"-n", "-W", "--keep-going", # be strict
8385
"source", # where the rst files are located

0 commit comments

Comments
 (0)