Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump sphinx from 7.1.0 to 8.1.3 in /requirements #1922

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,8 @@ src/ansys/grpc/

# C extensions
*.so

# Ignore auto-generated API reference
doc/source/api
doc/source/examples
doc/source/images/auto-generated
41 changes: 39 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import os
import sys
from glob import glob
from datetime import datetime

import numpy as np
import pyvista
import sphinx
from ansys.dpf.core import __version__, server, server_factory
from ansys.dpf.core.examples import get_example_required_minimum_dpf_version
from ansys_sphinx_theme import ansys_favicon, get_version_match, pyansys_logo_light_mode, pyansys_logo_dark_mode
Expand Down Expand Up @@ -62,6 +62,9 @@
ignored_pattern += f"|{example_name}"
ignored_pattern += "|11-server_types.py"
ignored_pattern += "|06-distributed_stress_averaging.py"
# ignored_pattern += "|00-wrapping_numpy_capabilities.py"
# ignored_pattern += "|01-package_python_operators.py"
ignored_pattern += "|02-python_operators_with_dependencies.py"
ignored_pattern += r")"

# Autoapi ignore pattern
Expand Down Expand Up @@ -174,7 +177,7 @@ def reset_servers(gallery_conf, fname, when):
try:
# check whether the process name matches
if proc_name in proc.name():
# proc.kill()
proc.kill()
nb_procs += 1
except psutil.NoSuchProcess:
pass
Expand Down Expand Up @@ -367,3 +370,37 @@ def reset_servers(gallery_conf, fname, when):

# A list of files that should not be packed into the epub file.
epub_exclude_files = ["search.html"]


def close_live_servers_and_processes(app: sphinx.application.Sphinx) -> None:
# Adapted from reset_servers() function, so this can be called after
# sphinx gallery finishes execution
import psutil
from ansys.dpf.core import server
import gc

gc.collect()
server.shutdown_all_session_servers()

proc_name = "Ans.Dpf.Grpc"
nb_procs = 0
for proc in psutil.process_iter():
try:
# check whether the process name matches
if proc_name in proc.name():
proc.kill()
nb_procs += 1
except psutil.NoSuchProcess:
pass

def setup(app: sphinx.application.Sphinx) -> None:
"""
Run hook function(s) during the documentation build.

Parameters
----------
app : sphinx.application.Sphinx
Sphinx application instance containing the all the doc build configuration.
"""

app.connect("builder-inited", close_live_servers_and_processes)
4 changes: 2 additions & 2 deletions requirements/requirements_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ enum-tools[sphinx]==0.12.0
graphviz==0.20.1
imageio==2.36.0
imageio-ffmpeg==0.5.1
nbsphinx==0.9.6
nbsphinx==0.9.5
RobPasMue marked this conversation as resolved.
Show resolved Hide resolved
pypandoc==1.14
pytest-sphinx==0.6.3
pyvista==0.44.2
sphinx==7.4.7
sphinx==8.1.3
sphinx-copybutton==0.5.2
sphinx-gallery==0.18.0
sphinx-notfound-page==1.0.4
Expand Down
Loading