diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index b3630ac..c2d1268 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -104,6 +104,8 @@ jobs: run: | .venv\Scripts\Activate.ps1 python -m sphinx doc/source "doc/_build/html" --color -vW -b html + env: + REMOTING_SERVER_ADDRESS: "localhost" - name: "Upload HTML artifacts" uses: actions/upload-artifact@v4 @@ -162,6 +164,7 @@ jobs: uses: ansys/actions/doc-deploy-stable@v8 with: cname: ${{ env.DOCUMENTATION_CNAME }} - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} - bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} \ No newline at end of file + bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} + diff --git a/doc/source/advanced-examples.rst b/doc/source/advanced-examples.rst index 60d0803..aebc931 100644 --- a/doc/source/advanced-examples.rst +++ b/doc/source/advanced-examples.rst @@ -11,4 +11,3 @@ and other PyAnsys libraries. examples/cyclic-symmetry-analysis/main examples/axisymmetric-rotor/main examples/material-designer-workflow/main - examples/ansys-aedt-workflow/main \ No newline at end of file diff --git a/doc/source/basic-examples.rst b/doc/source/basic-examples.rst index 5f0d8cd..a7d723d 100644 --- a/doc/source/basic-examples.rst +++ b/doc/source/basic-examples.rst @@ -9,4 +9,3 @@ library. examples/logging/main examples/ansys-fluent-workflow/main examples/pymechanical-integration/main - examples/pyfluent-workflow/main diff --git a/doc/source/conf.py b/doc/source/conf.py index d918d1b..d7f18d7 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -4,6 +4,7 @@ import os import pathlib import shutil +from typing import List import sphinx from sphinx.util import logging @@ -44,7 +45,7 @@ templates_path = ['_templates'] -exclude_examples = ["grantami-integration"] +exclude_examples = ["grantami-integration", "ansys-aedt-workflow", "pyfluent-workflow"] exclude_patterns = [ "conf.py", "examples/**/scripts/*.py", @@ -93,7 +94,7 @@ ".mystnb": ["jupytext.reads", {"fmt": "mystnb"}], ".py": ["jupytext.reads", {"fmt": ""}], } -nbsphinx_allow_errors = True +nbsphinx_allow_errors = False nbsphinx_prompt_width = "" nbsphinx_thumbnails = { # Basic examples @@ -111,6 +112,35 @@ # -- Sphinx application setup ------------------------------------------------ +def copytree(src: pathlib.Path, dst: pathlib.Path, excluded: List[str]): + """ + Recursively copy a directory tree using pathlib. + + Args: + src (Path): The source directory to copy from. + dst (Path): The destination directory to copy to. + + Raises: + ValueError: If the source is not a directory. + """ + if not src.is_dir(): + raise ValueError(f"The source {src} is not a directory.") + + # Create the destination directory + dst.mkdir(parents=True, exist_ok=True) + + # Recursively copy files and subdirectories + for item in src.iterdir(): + if item.name in excluded: + continue + src_item = item + dst_item = dst / item.name + if src_item.is_dir(): + copytree(src_item, dst_item, excluded) + else: + shutil.copy2(src_item, dst_item) + + def copy_examples_dir_to_source_dir(app: sphinx.application.Sphinx): """ Copy the examples directory to the source directory of the documentation. @@ -122,12 +152,12 @@ def copy_examples_dir_to_source_dir(app: sphinx.application.Sphinx): """ SOURCE_EXAMPLES = pathlib.Path(app.srcdir) / "examples" - if not SOURCE_EXAMPLES.exists(): - SOURCE_EXAMPLES.mkdir(parents=True, exist_ok=True) + SOURCE_EXAMPLES.mkdir(parents=True, exist_ok=True) EXAMPLES_DIRECTORY = SOURCE_EXAMPLES.parent.parent.parent / "examples" - shutil.copytree(EXAMPLES_DIRECTORY, SOURCE_EXAMPLES, dirs_exist_ok=True) + copytree(EXAMPLES_DIRECTORY, SOURCE_EXAMPLES, exclude_examples) + def copy_examples_to_output_dir(app: sphinx.application.Sphinx, exception: Exception): """ @@ -202,5 +232,5 @@ def setup(app: sphinx.application.Sphinx): # build has completed, no matter its success, the examples are removed from # the source directory. app.connect("builder-inited", copy_examples_dir_to_source_dir) - #app.connect("build-finished", remove_examples_from_source_dir) + app.connect("build-finished", remove_examples_from_source_dir) app.connect("build-finished", copy_examples_to_output_dir) diff --git a/requirements/requirements_examples.txt b/requirements/requirements_examples.txt index 6cf6341..cdc83c1 100644 --- a/requirements/requirements_examples.txt +++ b/requirements/requirements_examples.txt @@ -1,5 +1,5 @@ -ansys-workbench-core @ git+https://github.com/ansys/pyworkbench -ansys-fluent-core==0.27.0 +ansys-workbench-core==0.7.0 +ansys-fluent-core==0.26.0 ansys-fluent-visualization==0.14.0 pyaedt == 0.11.4 ansys-mechanical-core==0.11.10