Skip to content

Commit a8f8b15

Browse files
committed
WIP: Remove dependencies from doc-noexamples
1 parent 390317b commit a8f8b15

File tree

2 files changed

+17
-39
lines changed

2 files changed

+17
-39
lines changed

doc/source/conf.py

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
import sys
88
import warnings
99

10-
import pyvista
1110
import numpy as np
12-
import json
1311
from sphinx_gallery.sorting import FileNameSortKey
1412
from ansys_sphinx_theme import (ansys_favicon,
1513
get_version_match, pyansys_logo_black,
@@ -230,26 +228,27 @@ def setup(app):
230228
# The name of the Pygments (syntax highlighting) style to use.
231229
pygments_style = "sphinx"
232230

233-
# Manage errors
234-
pyvista.set_error_output_file("errors.txt")
235-
236-
# Ensure that offscreen rendering is used for docs generation
237-
pyvista.OFF_SCREEN = True
238-
239-
# Preferred plotting style for documentation
240-
# pyvista.set_plot_theme('document')
241-
242-
# must be less than or equal to the XVFB window size
243-
pyvista.global_theme["window_size"] = np.array([1024, 768])
244-
245-
# Save figures in specified directory
246-
pyvista.FIGURE_PATH = os.path.join(os.path.abspath("./images/"), "auto-generated/")
247-
if not os.path.exists(pyvista.FIGURE_PATH):
248-
os.makedirs(pyvista.FIGURE_PATH)
249231

250232
# gallery build requires AEDT install
251233
# if is_windows and bool(os.getenv("PYAEDT_CI_RUN_EXAMPLES", "0")):
252234
if run_examples:
235+
import pyvista
236+
237+
# # Pyvista settings
238+
239+
# Ensure that offscreen rendering is used for docs generation
240+
pyvista.OFF_SCREEN = True
241+
# Save figures in specified directory
242+
pyvista.FIGURE_PATH = os.path.join(os.path.abspath("./images/"), "auto-generated/")
243+
if not os.path.exists(pyvista.FIGURE_PATH):
244+
os.makedirs(pyvista.FIGURE_PATH)
245+
# Necessary for pyvista when building the sphinx gallery
246+
pyvista.BUILDING_GALLERY = True
247+
248+
# Manage errors
249+
pyvista.set_error_output_file("errors.txt")
250+
# Must be less than or equal to the XVFB window size
251+
pyvista.global_theme["window_size"] = np.array([1024, 768])
253252

254253
# suppress annoying matplotlib bug
255254
warnings.filterwarnings(
@@ -258,9 +257,6 @@ def setup(app):
258257
message="Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.",
259258
)
260259

261-
# necessary for pyvista when building the sphinx gallery
262-
pyvista.BUILDING_GALLERY = True
263-
264260
extensions.append("sphinx_gallery.gen_gallery")
265261
sphinx_gallery_conf = {
266262
# convert rst to md for ipynb
@@ -289,18 +285,6 @@ def setup(app):
289285
"run_examples": run_examples,
290286
},
291287
}
292-
# def prepare_jinja_env(jinja_env) -> None:
293-
# """
294-
# Customize the jinja env.
295-
#
296-
# Notes
297-
# -----
298-
# See https://jinja.palletsprojects.com/en/3.0.x/api/#jinja2.Environment
299-
# """
300-
# jinja_env.globals["project_name"] = project
301-
#
302-
#
303-
# autoapi_prepare_jinja_env = prepare_jinja_env
304288

305289
# -- Options for HTML output -------------------------------------------------
306290
html_short_title = html_title = "PyAEDT"

pyproject.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,8 @@ doc-noexamples = [
112112
"ansys-sphinx-theme==0.13.1",
113113
"imageio==2.31.5",
114114
"imageio-ffmpeg==0.4.9",
115-
"matplotlib==3.5.3; python_version == '3.7'",
116-
"matplotlib==3.7.3; python_version == '3.8'",
117-
"matplotlib==3.8.0; python_version > '3.8'",
118115
"numpydoc==1.5.0; python_version == '3.7'",
119116
"numpydoc==1.6.0; python_version > '3.7'",
120-
"vtk==9.2.6",
121-
"pyvista==0.42.2; python_version > '3.7'",
122-
"pyvista==0.38.0; python_version <= '3.7'",
123117
"recommonmark==0.7.1",
124118
"Sphinx==7.1.2; python_version <= '3.9'",
125119
"Sphinx==7.2.6; python_version >= '3.9'",

0 commit comments

Comments
 (0)