Skip to content

Commit aaffc89

Browse files
authored
chore: add 'docfx' nox session (googleapis#105)
Closes googleapis#104
1 parent ec08e66 commit aaffc89

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

noxfile.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,38 @@ def docs(session):
152152
os.path.join("docs", ""),
153153
os.path.join("docs", "_build", "html", ""),
154154
)
155+
156+
157+
@nox.session(python="3.7")
158+
def docfx(session):
159+
"""Build the docfx yaml files for this library."""
160+
161+
session.install("-e", ".")
162+
# sphinx-docfx-yaml supports up to sphinx version 1.5.5.
163+
# https://github.com/docascode/sphinx-docfx-yaml/issues/97
164+
session.install("sphinx==1.5.5", "alabaster", "recommonmark", "sphinx-docfx-yaml")
165+
166+
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
167+
session.run(
168+
"sphinx-build",
169+
"-T", # show full traceback on exception
170+
"-N", # no colors
171+
"-D",
172+
(
173+
"extensions=sphinx.ext.autodoc,"
174+
"sphinx.ext.autosummary,"
175+
"docfx_yaml.extension,"
176+
"sphinx.ext.intersphinx,"
177+
"sphinx.ext.coverage,"
178+
"sphinx.ext.napoleon,"
179+
"sphinx.ext.todo,"
180+
"sphinx.ext.viewcode,"
181+
"recommonmark"
182+
),
183+
"-b",
184+
"html",
185+
"-d",
186+
os.path.join("docs", "_build", "doctrees", ""),
187+
os.path.join("docs", ""),
188+
os.path.join("docs", "_build", "html", ""),
189+
)

0 commit comments

Comments
 (0)