@@ -168,6 +168,52 @@ def docs(session):
168168 )
169169
170170
171+ @nox .session (python = "3.10" )
172+ def docfx (session ):
173+ """Build the docfx yaml files for this library."""
174+
175+ session .install ("-e" , "." )
176+ session .install (
177+ # We need to pin to specific versions of the `sphinxcontrib-*` packages
178+ # which still support sphinx 4.x.
179+ # See https://github.com/googleapis/sphinx-docfx-yaml/issues/344
180+ # and https://github.com/googleapis/sphinx-docfx-yaml/issues/345.
181+ "sphinxcontrib-applehelp==1.0.4" ,
182+ "sphinxcontrib-devhelp==1.0.2" ,
183+ "sphinxcontrib-htmlhelp==2.0.1" ,
184+ "sphinxcontrib-qthelp==1.0.3" ,
185+ "sphinxcontrib-serializinghtml==1.1.5" ,
186+ "gcp-sphinx-docfx-yaml" ,
187+ "alabaster" ,
188+ "recommonmark" ,
189+ )
190+
191+ shutil .rmtree (os .path .join ("docs" , "_build" ), ignore_errors = True )
192+ session .run (
193+ "sphinx-build" ,
194+ "-T" , # show full traceback on exception
195+ "-N" , # no colors
196+ "-D" ,
197+ (
198+ "extensions=sphinx.ext.autodoc,"
199+ "sphinx.ext.autosummary,"
200+ "docfx_yaml.extension,"
201+ "sphinx.ext.intersphinx,"
202+ "sphinx.ext.coverage,"
203+ "sphinx.ext.napoleon,"
204+ "sphinx.ext.todo,"
205+ "sphinx.ext.viewcode,"
206+ "recommonmark"
207+ ),
208+ "-b" ,
209+ "html" ,
210+ "-d" ,
211+ os .path .join ("docs" , "_build" , "doctrees" , "" ),
212+ os .path .join ("docs" , "" ),
213+ os .path .join ("docs" , "_build" , "html" , "" ),
214+ )
215+
216+
171217@nox .session (python = "pypy" )
172218def pypy (session ):
173219 session .install ("-e" , ".[testing]" )
0 commit comments