Skip to content

Commit 4edc154

Browse files
committed
tests: add docfx nox session
1 parent 7736ba2 commit 4edc154

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

packages/google-cloud-ndb/noxfile.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,53 @@ def docs(session):
324324
)
325325

326326

327+
328+
@nox.session(python="3.10")
329+
def docfx(session):
330+
"""Build the docfx yaml files for this library."""
331+
332+
session.install("-e", ".")
333+
session.install(
334+
# We need to pin to specific versions of the `sphinxcontrib-*` packages
335+
# which still support sphinx 4.x.
336+
# See https://github.com/googleapis/sphinx-docfx-yaml/issues/344
337+
# and https://github.com/googleapis/sphinx-docfx-yaml/issues/345.
338+
"sphinxcontrib-applehelp==1.0.4",
339+
"sphinxcontrib-devhelp==1.0.2",
340+
"sphinxcontrib-htmlhelp==2.0.1",
341+
"sphinxcontrib-qthelp==1.0.3",
342+
"sphinxcontrib-serializinghtml==1.1.5",
343+
"gcp-sphinx-docfx-yaml",
344+
"alabaster",
345+
"recommonmark",
346+
)
347+
348+
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
349+
session.run(
350+
"sphinx-build",
351+
"-T", # show full traceback on exception
352+
"-N", # no colors
353+
"-D",
354+
(
355+
"extensions=sphinx.ext.autodoc,"
356+
"sphinx.ext.autosummary,"
357+
"docfx_yaml.extension,"
358+
"sphinx.ext.intersphinx,"
359+
"sphinx.ext.coverage,"
360+
"sphinx.ext.napoleon,"
361+
"sphinx.ext.todo,"
362+
"sphinx.ext.viewcode,"
363+
"recommonmark"
364+
),
365+
"-b",
366+
"html",
367+
"-d",
368+
os.path.join("docs", "_build", "doctrees", ""),
369+
os.path.join("docs", ""),
370+
os.path.join("docs", "_build", "html", ""),
371+
)
372+
373+
327374
@nox.session(py="3.9")
328375
def doctest(session):
329376
# Install all dependencies.

0 commit comments

Comments
 (0)