Skip to content

Commit

Permalink
Merge pull request #1365 from pradyunsg/use-shared-cache-for-doctrees
Browse files Browse the repository at this point in the history
Use a shared cache directory for Sphinx builds across nox sessions
  • Loading branch information
webknjaz committed Nov 7, 2023
2 parents 9d06acf + 5020425 commit 43c451f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# http://creativecommons.org/licenses/by-sa/3.0.

import shutil
import nox

import nox

nox.options.sessions = []

Expand All @@ -20,7 +20,7 @@ def translation(session):
session.run(
"sphinx-build",
"-b", "gettext", # build gettext-style message catalogs (.pot file)
"-d", ".nox/.doctrees/", # path to put the cache
"-d", session.cache_dir / ".doctrees", # path to put the cache
"source/", # where the rst files are located
target_dir, # where to put the .pot file
)
Expand Down Expand Up @@ -52,6 +52,7 @@ def build(session, autobuild=False):
command, *extra_args,
"-j", "auto", # parallelize the build
"-b", "html", # use HTML builder
"-d", session.cache_dir / ".doctrees", # path to put the cache
"-n", # nitpicky warn about all missing references
"-W", # Treat warnings as errors.
*session.posargs,
Expand All @@ -78,6 +79,7 @@ def linkcheck(session):
session.run(
"sphinx-build",
"-b", "linkcheck", # use linkcheck builder
"-d", session.cache_dir / ".doctrees", # path to put the cache
"--color",
"-n", "-W", "--keep-going", # be strict
"source", # where the rst files are located
Expand Down

0 comments on commit 43c451f

Please sign in to comment.