From f6240ace5f23302c68dbdcc3af66182babfffd86 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 4 Dec 2024 09:25:04 +0100 Subject: [PATCH 1/9] feat: first commit that results in sucessful documentation build --- .ci/build_doc.bat | 38 +++++++++--------- doc/source/api/index.rst | 15 ++++---- doc/source/conf.py | 62 +++++++++++++++++++++++++++--- requirements/requirements_docs.txt | 1 + 4 files changed, 85 insertions(+), 31 deletions(-) diff --git a/.ci/build_doc.bat b/.ci/build_doc.bat index f5a447971d..2a5d1e90ad 100644 --- a/.ci/build_doc.bat +++ b/.ci/build_doc.bat @@ -1,28 +1,28 @@ -set SPHINX_APIDOC_OPTIONS=inherited-members -call sphinx-apidoc -o ../doc/source/api ../src/ansys ../src/ansys/dpf/core/log.py ^ -../src/ansys/dpf/core/help.py ../src/ansys/dpf/core/mapping_types.py ../src/ansys/dpf/core/ipconfig.py ^ -../src/ansys/dpf/core/field_base.py ../src/ansys/dpf/core/cache.py ../src/ansys/dpf/core/misc.py ^ -../src/ansys/dpf/core/check_version.py ../src/ansys/dpf/core/operators/build.py ../src/ansys/dpf/core/operators/specification.py ^ -../src/ansys/dpf/core/vtk_helper.py ../src/ansys/dpf/core/label_space.py ../src/ansys/dpf/core/examples/python_plugins/* ^ -../src/ansys/dpf/core/examples/examples.py ../src/ansys/dpf/gate/* ../src/ansys/dpf/gatebin/* ../src/ansys/grpc/dpf/* ^ - ../src/ansys/dpf/core/property_fields_container.py ^ - -f --implicit-namespaces --separate --no-headings +@echo off + +REM Move to the documentation directory pushd . cd ../doc/ + +REM Clean the previous build call make clean + +REM Build the HTML documentation call make html -v -v -v -P +REM Display the directory contents for verification dir -rem Patch pyVista issue with elemental plots +REM Patch pyVista issue with elemental plots by copying necessary images +xcopy source\examples\04-advanced\02-volume_averaged_stress\sphx_glr_02-volume_averaged_stress_001.png build\html\_images\ /y /f +xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_001.png build\html\_images\ /y /f +xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_002.png build\html\_images\ /y /f +xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_003.png build\html\_images\ /y /f +xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_004.png build\html\_images\ /y /f +xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_005.png build\html\_images\ /y /f +xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_006.png build\html\_images\ /y /f +xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_007.png build\html\_images\ /y /f +xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_thumb.png build\html\_images\ /y /f -xcopy source\examples\04-advanced\02-volume_averaged_stress\sphx_glr_02-volume_averaged_stress_001.png build\html\_images\ /y /f -xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_001.png build\html\_images\ /y /f -xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_002.png build\html\_images\ /y /f -xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_003.png build\html\_images\ /y /f -xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_004.png build\html\_images\ /y /f -xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_005.png build\html\_images\ /y /f -xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_006.png build\html\_images\ /y /f -xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_007.png build\html\_images\ /y /f -xcopy source\examples\12-fluids\02-fluids_results\sphx_glr_02-fluids_results_thumb.png build\html\_images\ /y /f +REM Return to the original directory popd diff --git a/doc/source/api/index.rst b/doc/source/api/index.rst index 2591e619ba..84a8a29d1c 100644 --- a/doc/source/api/index.rst +++ b/doc/source/api/index.rst @@ -1,10 +1,11 @@ -.. _ref_api_section: - -============= API reference ============= + +This section describes PyDPF-Core endpoints, their capabilities, and how +to interact with them programmatically. + .. toctree:: - :maxdepth: 2 - :caption: API reference - - ansys.dpf.core + :titlesonly: + :maxdepth: 3 + + ansys.dpf.core diff --git a/doc/source/conf.py b/doc/source/conf.py index 7390890e9c..8b31f855c3 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -62,8 +62,32 @@ ignored_pattern += f"|{example_name}" ignored_pattern += "|11-server_types.py" ignored_pattern += "|06-distributed_stress_averaging.py" +ignored_pattern += "|02-python_operators_with_dependencies.py" +ignored_pattern += "|00-fluids_model.py" ignored_pattern += r")" +# Autoapi ignore pattern +autoapi_ignore_list = [ + "*/log.py", + "*/help.py", + "*/mapping_types.py", + "*/ipconfig.py", + "*/field_base.py", + "*/cache.py", + "*/misc.py", + "*/check_version.py", + "*/operators/build.py", + "*/operators/specification.py", + "*/vtk_helper.py", + "*/label_space.py", + "*/examples/python_plugins/*", + "*/examples/examples.py", + "*/gate/*", + "*/gatebin/*", + "*/grpc/*", + "*/property_fields_container.py" +] + # -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. @@ -77,16 +101,17 @@ "enum_tools.autoenum", "nbsphinx", "sphinx.ext.autosectionlabel", - "sphinx.ext.autodoc", + #"sphinx.ext.autodoc", "sphinx.ext.graphviz", "sphinx.ext.intersphinx", "sphinx.ext.napoleon", "sphinx.ext.todo", - "sphinx_autodoc_typehints", + #"sphinx_autodoc_typehints", "sphinx_copybutton", "sphinx_design", "sphinx_gallery.gen_gallery", 'sphinx_reredirects', + "ansys_sphinx_theme.extension.autoapi" ] redirects = { @@ -107,7 +132,7 @@ autosummary_generate = True -autodoc_mock_imports = ["ansys.dpf.core.examples.python_plugins"] +#autodoc_mock_imports = ["ansys.dpf.core.examples.python_plugins"] # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] @@ -189,7 +214,7 @@ def reset_servers(gallery_conf, fname, when): "reset_modules": (reset_servers,), } -autodoc_member_order = "bysource" +#autodoc_member_order = "bysource" # -- Options for HTML output ------------------------------------------------- @@ -217,9 +242,36 @@ def reset_servers(gallery_conf, fname, when): "min_chars_for_search": 2, "ignoreLocation": True, }, + "ansys_sphinx_theme_autoapi": { + "project": project, + "output": "api", + "directory": "src/ansys", + "use_implicit_namespaces": True, + "keep_files": True, + "own_page_level": "class", + "type": "python", + "options": [ + "members", + "undoc-members", + "show-inheritance", + "show-module-summary", + "special-members", + ], + "class_content": "class", + "ignore": autoapi_ignore_list, + "add_toctree_entry": True, + #"package_depth": 3, + "member_order": "bysource", + } } - +# Configuration for Sphinx autoapi +suppress_warnings = [ + "autoapi.python_import_resolution", + "design.grid", + "config.cache", + "design.fa-build", +] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, diff --git a/requirements/requirements_docs.txt b/requirements/requirements_docs.txt index 9906654e9e..a0ece0984a 100644 --- a/requirements/requirements_docs.txt +++ b/requirements/requirements_docs.txt @@ -1,4 +1,5 @@ ansys-sphinx-theme==1.2.2 +ansys-sphinx-theme[autoapi]==1.2.2 enum-tools[sphinx]==0.12.0 graphviz==0.20.1 imageio==2.36.0 From 6ce5d9473b94f6b511bf29d518d10c3d096a75dd Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 4 Dec 2024 11:28:51 +0100 Subject: [PATCH 2/9] feat: bumped sphinx version manually to 8.1.3 --- requirements/requirements_docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements_docs.txt b/requirements/requirements_docs.txt index a0ece0984a..2a2bdb14c8 100644 --- a/requirements/requirements_docs.txt +++ b/requirements/requirements_docs.txt @@ -8,7 +8,7 @@ nbsphinx==0.9.5 pypandoc==1.14 pytest-sphinx==0.6.3 pyvista==0.44.2 -sphinx==7.1.0 +sphinx==8.1.3 sphinx-copybutton==0.5.2 sphinx-gallery==0.18.0 sphinx-notfound-page==1.0.4 From 7b334a947974324d90568b2b08f94f5985ffbee1 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Wed, 4 Dec 2024 12:06:15 +0100 Subject: [PATCH 3/9] feat: cleaned up conf.py --- doc/source/conf.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 8b31f855c3..c19067d7ec 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -101,12 +101,10 @@ "enum_tools.autoenum", "nbsphinx", "sphinx.ext.autosectionlabel", - #"sphinx.ext.autodoc", "sphinx.ext.graphviz", "sphinx.ext.intersphinx", "sphinx.ext.napoleon", "sphinx.ext.todo", - #"sphinx_autodoc_typehints", "sphinx_copybutton", "sphinx_design", "sphinx_gallery.gen_gallery", @@ -132,7 +130,6 @@ autosummary_generate = True -#autodoc_mock_imports = ["ansys.dpf.core.examples.python_plugins"] # Add any paths that contain templates here, relative to this directory. # templates_path = ['_templates'] @@ -214,8 +211,6 @@ def reset_servers(gallery_conf, fname, when): "reset_modules": (reset_servers,), } -#autodoc_member_order = "bysource" - # -- Options for HTML output ------------------------------------------------- html_short_title = html_title = "PyDPF-Core" @@ -260,7 +255,6 @@ def reset_servers(gallery_conf, fname, when): "class_content": "class", "ignore": autoapi_ignore_list, "add_toctree_entry": True, - #"package_depth": 3, "member_order": "bysource", } } From d16becbb4a414c52f25514cae80b3b376e154e39 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Fri, 13 Dec 2024 15:43:31 +0100 Subject: [PATCH 4/9] doc: sphinx 7.4.7 works for autoapi --- doc/source/conf.py | 5 ++--- requirements/requirements_docs.txt | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index c19067d7ec..ffd92d8e88 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -63,7 +63,6 @@ ignored_pattern += "|11-server_types.py" ignored_pattern += "|06-distributed_stress_averaging.py" ignored_pattern += "|02-python_operators_with_dependencies.py" -ignored_pattern += "|00-fluids_model.py" ignored_pattern += r")" # Autoapi ignore pattern @@ -109,7 +108,7 @@ "sphinx_design", "sphinx_gallery.gen_gallery", 'sphinx_reredirects', - "ansys_sphinx_theme.extension.autoapi" + "ansys_sphinx_theme.extension.autoapi", ] redirects = { @@ -128,7 +127,7 @@ "pyvista": ("https://docs.pyvista.org/", None), } -autosummary_generate = True +autosummary_generate = False # Add any paths that contain templates here, relative to this directory. diff --git a/requirements/requirements_docs.txt b/requirements/requirements_docs.txt index 2a2bdb14c8..3f937a6703 100644 --- a/requirements/requirements_docs.txt +++ b/requirements/requirements_docs.txt @@ -8,7 +8,7 @@ nbsphinx==0.9.5 pypandoc==1.14 pytest-sphinx==0.6.3 pyvista==0.44.2 -sphinx==8.1.3 +sphinx==7.4.7 sphinx-copybutton==0.5.2 sphinx-gallery==0.18.0 sphinx-notfound-page==1.0.4 From c0bdb08f853624027968a78204cb9ab751813943 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Sat, 14 Dec 2024 10:27:51 +0100 Subject: [PATCH 5/9] fix: ci doc build resulting in error --- .ci/build_doc.bat | 2 -- doc/source/conf.py | 1 - 2 files changed, 3 deletions(-) diff --git a/.ci/build_doc.bat b/.ci/build_doc.bat index 2a5d1e90ad..e1b50c8448 100644 --- a/.ci/build_doc.bat +++ b/.ci/build_doc.bat @@ -1,5 +1,3 @@ -@echo off - REM Move to the documentation directory pushd . cd ../doc/ diff --git a/doc/source/conf.py b/doc/source/conf.py index e1b7a34961..e7f9775035 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -97,7 +97,6 @@ # ones. extensions = [ "enum_tools.autoenum", - "nbsphinx", "sphinx.ext.autosectionlabel", "sphinx.ext.graphviz", "sphinx.ext.intersphinx", From f23c959084eea754c5b7e2aa2014d0ec39a41b51 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Sat, 14 Dec 2024 13:49:19 +0100 Subject: [PATCH 6/9] fix: check if modifying action file fixes doc-build error --- .github/workflows/docs.yml | 53 +++++++++++++++++++++++++++++++++++--- src/ansys/dpf/core/misc.py | 4 +-- 2 files changed, 52 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2ba37ecbe1..a3d96215b3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -143,10 +143,57 @@ jobs: run: pip list - name: "Build HTML Documentation" - shell: cmd /D /E:ON /V:OFF /C "CALL "{0}"" - working-directory: .ci + shell: bash run: | - build_doc.bat > ..\doc\log.txt && type ..\doc\log.txt 2>&1 + # Navigate to the documentation directory + cd doc + + # Create a log file for output redirection + LOG_FILE="../doc/log.txt" + exec > >(tee -a "$LOG_FILE") 2>&1 + + echo "Starting documentation build process..." + + # Backup files from source/examples and source/_temp/plugins before cleaning + echo "Backing up files before cleaning..." + mkdir -p source/_backup + [ -d "source/examples/07-python-operators/plugins" ] && cp -r source/examples/07-python-operators/plugins source/_backup/plugins || true + [ -d "source/examples/04-advanced/02-volume_averaged_stress" ] && cp -r source/examples/04-advanced/02-volume_averaged_stress source/_backup/04_advanced || true + [ -d "source/examples/12-fluids/02-fluids_results" ] && cp -r source/examples/12-fluids/02-fluids_results source/_backup/12_fluids || true + + # Clean previous builds + echo "Cleaning previous build artifacts..." + rm -rf build source/images/auto-generated source/examples + rm -rf source/_temp || true + + # Restore backed-up files + echo "Restoring backed-up files..." + mkdir -p source/examples/07-python-operators + [ -d "source/_backup/plugins" ] && cp -r source/_backup/plugins source/examples/07-python-operators/plugins || true + mkdir -p source/examples/04-advanced + [ -d "source/_backup/04_advanced" ] && cp -r source/_backup/04_advanced source/examples/04-advanced/02-volume_averaged_stress || true + mkdir -p source/examples/12-fluids + [ -d "source/_backup/12_fluids" ] && cp -r source/_backup/12_fluids source/examples/12-fluids/02-fluids_results || true + rm -rf source/_backup || true + + # Build the HTML documentation + echo "Building HTML documentation..." + sphinx-build -b html source build/html -v + + # Copy necessary images to the build directory + echo "Copying images for patching pyVista issues..." + mkdir -p build/html/_images + cp -v source/examples/04-advanced/02-volume_averaged_stress/sphx_glr_02-volume_averaged_stress_001.png build/html/_images/ || true + cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_00*.png build/html/_images/ || true + cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_thumb.png build/html/_images/ || true + + # Verify the output + echo "Documentation build completed. Verifying contents..." + ls -R build/html + + # Display the log file content + echo "Displaying the log file content..." + cat "$LOG_FILE" timeout-minutes: 60 env: MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} diff --git a/src/ansys/dpf/core/misc.py b/src/ansys/dpf/core/misc.py index c10c42a41b..bc0b7354b7 100644 --- a/src/ansys/dpf/core/misc.py +++ b/src/ansys/dpf/core/misc.py @@ -183,9 +183,9 @@ def find_ansys(): if base_path is None: return base_path - paths = base_path.glob("v*") + paths = list(base_path.glob("v*")) - if not list(paths): + if not paths: return None versions = {} From 284c7a61fa465c1f3521a1bef7c462dfc273668b Mon Sep 17 00:00:00 2001 From: moe-ad Date: Sat, 14 Dec 2024 15:45:14 +0100 Subject: [PATCH 7/9] fix: quick test --- requirements/requirements_docs.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/requirements_docs.txt b/requirements/requirements_docs.txt index 3f937a6703..2a2bdb14c8 100644 --- a/requirements/requirements_docs.txt +++ b/requirements/requirements_docs.txt @@ -8,7 +8,7 @@ nbsphinx==0.9.5 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 From c8765dff5c4c58a1e8023a59519b23734615dcf2 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Sat, 14 Dec 2024 18:34:05 +0100 Subject: [PATCH 8/9] fix: trialing another fix --- .ci/build_doc.bat | 2 + .github/workflows/docs.yml | 110 ++++++++++++----------------- requirements/requirements_docs.txt | 2 +- 3 files changed, 49 insertions(+), 65 deletions(-) diff --git a/.ci/build_doc.bat b/.ci/build_doc.bat index e1b50c8448..2a5d1e90ad 100644 --- a/.ci/build_doc.bat +++ b/.ci/build_doc.bat @@ -1,3 +1,5 @@ +@echo off + REM Move to the documentation directory pushd . cd ../doc/ diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a3d96215b3..83c9d0ee3a 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -73,17 +73,36 @@ jobs: with: python-version: ${{ inputs.python_version }} + - name: "Create virtual environment in the current workspace" + shell: pwsh + run: python -m venv .venv --system-site-packages + + - name: "Update PATH for virtual environment" + run: | + echo "${{ github.workspace }}\.venv\Scripts" >> $env:GITHUB_PATH + + - name: "Update pip to the latest version" + shell: pwsh + run: | +# .venv\Scripts\Activate.ps1 + python -m pip install -U pip + - name: "Install requirements" - run: pip install -r requirements/requirements_build.txt + shell: pwsh + run: | +# .venv\Scripts\Activate.ps1 + python -m pip install -r requirements/requirements_build.txt - name: "Build the wheel" - shell: bash + shell: pwsh run: | - if [ ${{ matrix.os }} == "ubuntu-latest" ]; then - export platform="manylinux_2_17" - else - export platform="win" - fi + $os = "${{ matrix.os }}" + if ($os -eq "ubuntu-latest") { + $platform = "manylinux_2_17" + } else { + $platform = "win" + } +# .venv\Scripts\Activate.ps1 python .ci/build_wheel.py -p $platform -w - name: "Expose the wheel" @@ -96,9 +115,10 @@ jobs: echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT - name: "Install package wheel" - shell: bash + shell: pwsh run: | - pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] +# .venv\Scripts\Activate.ps1 + python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] - name: "Install DPF" id: set-server-path @@ -112,9 +132,11 @@ jobs: uses: ansys/pydpf-actions/check-licenses@v2.3 - name: "Test import" - shell: bash + shell: pwsh working-directory: tests - run: python -c "from ansys.dpf import core" + run: | +# ..\.venv\Scripts\Activate.ps1 + python -c "from ansys.dpf import core" - name: "Setup headless display" uses: pyvista/setup-headless-display-action@v2 @@ -127,73 +149,33 @@ jobs: choco install pandoc - name: "Install documentation packages for Python" + shell: pwsh run: | - pip install -r requirements/requirements_docs.txt +# .venv\Scripts\Activate.ps1 + python -m pip install -r requirements/requirements_docs.txt - name: "Kill all servers" uses: ansys/pydpf-actions/kill-dpf-servers@v2.3 - name: "Ensure VTK compatibility" + shell: pwsh run: | +# .venv\Scripts\Activate.ps1 python -m pip uninstall --yes vtk python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==${{ env.VTK_OSMESA_VERSION }} - name: "List installed packages" - shell: bash - run: pip list + shell: pwsh + run: | +# .venv\Scripts\Activate.ps1 + python -m pip list - name: "Build HTML Documentation" - shell: bash + shell: cmd /D /E:ON /V:OFF /C "CALL "{0}"" + working-directory: .ci run: | - # Navigate to the documentation directory - cd doc - - # Create a log file for output redirection - LOG_FILE="../doc/log.txt" - exec > >(tee -a "$LOG_FILE") 2>&1 - - echo "Starting documentation build process..." - - # Backup files from source/examples and source/_temp/plugins before cleaning - echo "Backing up files before cleaning..." - mkdir -p source/_backup - [ -d "source/examples/07-python-operators/plugins" ] && cp -r source/examples/07-python-operators/plugins source/_backup/plugins || true - [ -d "source/examples/04-advanced/02-volume_averaged_stress" ] && cp -r source/examples/04-advanced/02-volume_averaged_stress source/_backup/04_advanced || true - [ -d "source/examples/12-fluids/02-fluids_results" ] && cp -r source/examples/12-fluids/02-fluids_results source/_backup/12_fluids || true - - # Clean previous builds - echo "Cleaning previous build artifacts..." - rm -rf build source/images/auto-generated source/examples - rm -rf source/_temp || true - - # Restore backed-up files - echo "Restoring backed-up files..." - mkdir -p source/examples/07-python-operators - [ -d "source/_backup/plugins" ] && cp -r source/_backup/plugins source/examples/07-python-operators/plugins || true - mkdir -p source/examples/04-advanced - [ -d "source/_backup/04_advanced" ] && cp -r source/_backup/04_advanced source/examples/04-advanced/02-volume_averaged_stress || true - mkdir -p source/examples/12-fluids - [ -d "source/_backup/12_fluids" ] && cp -r source/_backup/12_fluids source/examples/12-fluids/02-fluids_results || true - rm -rf source/_backup || true - - # Build the HTML documentation - echo "Building HTML documentation..." - sphinx-build -b html source build/html -v - - # Copy necessary images to the build directory - echo "Copying images for patching pyVista issues..." - mkdir -p build/html/_images - cp -v source/examples/04-advanced/02-volume_averaged_stress/sphx_glr_02-volume_averaged_stress_001.png build/html/_images/ || true - cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_00*.png build/html/_images/ || true - cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_thumb.png build/html/_images/ || true - - # Verify the output - echo "Documentation build completed. Verifying contents..." - ls -R build/html - - # Display the log file content - echo "Displaying the log file content..." - cat "$LOG_FILE" +# ..\.venv\Scripts\activate.bat + build_doc.bat > ..\doc\log.txt && type ..\doc\log.txt 2>&1 timeout-minutes: 60 env: MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }} diff --git a/requirements/requirements_docs.txt b/requirements/requirements_docs.txt index 2a2bdb14c8..3f937a6703 100644 --- a/requirements/requirements_docs.txt +++ b/requirements/requirements_docs.txt @@ -8,7 +8,7 @@ nbsphinx==0.9.5 pypandoc==1.14 pytest-sphinx==0.6.3 pyvista==0.44.2 -sphinx==8.1.3 +sphinx==7.4.7 sphinx-copybutton==0.5.2 sphinx-gallery==0.18.0 sphinx-notfound-page==1.0.4 From 7d80e672f65c25edb509d7c6e4982963a48b2f80 Mon Sep 17 00:00:00 2001 From: moe-ad Date: Sat, 14 Dec 2024 20:13:24 +0100 Subject: [PATCH 9/9] fix: modified docs.yml file --- .github/workflows/docs.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 83c9d0ee3a..c1fab71c7d 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -84,13 +84,11 @@ jobs: - name: "Update pip to the latest version" shell: pwsh run: | -# .venv\Scripts\Activate.ps1 python -m pip install -U pip - name: "Install requirements" shell: pwsh run: | -# .venv\Scripts\Activate.ps1 python -m pip install -r requirements/requirements_build.txt - name: "Build the wheel" @@ -102,7 +100,6 @@ jobs: } else { $platform = "win" } -# .venv\Scripts\Activate.ps1 python .ci/build_wheel.py -p $platform -w - name: "Expose the wheel" @@ -117,7 +114,6 @@ jobs: - name: "Install package wheel" shell: pwsh run: | -# .venv\Scripts\Activate.ps1 python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting] - name: "Install DPF" @@ -135,7 +131,6 @@ jobs: shell: pwsh working-directory: tests run: | -# ..\.venv\Scripts\Activate.ps1 python -c "from ansys.dpf import core" - name: "Setup headless display" @@ -151,7 +146,6 @@ jobs: - name: "Install documentation packages for Python" shell: pwsh run: | -# .venv\Scripts\Activate.ps1 python -m pip install -r requirements/requirements_docs.txt - name: "Kill all servers" @@ -160,21 +154,18 @@ jobs: - name: "Ensure VTK compatibility" shell: pwsh run: | -# .venv\Scripts\Activate.ps1 python -m pip uninstall --yes vtk python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==${{ env.VTK_OSMESA_VERSION }} - name: "List installed packages" shell: pwsh run: | -# .venv\Scripts\Activate.ps1 python -m pip list - name: "Build HTML Documentation" shell: cmd /D /E:ON /V:OFF /C "CALL "{0}"" working-directory: .ci run: | -# ..\.venv\Scripts\activate.bat build_doc.bat > ..\doc\log.txt && type ..\doc\log.txt 2>&1 timeout-minutes: 60 env: