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