Skip to content

Commit

Permalink
WIP: test clean from sphynx
Browse files Browse the repository at this point in the history
  • Loading branch information
SMoraisAnsys committed Nov 6, 2023
1 parent 0b6d0aa commit 883aa2a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 10 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test_first_no_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ jobs:
run: |
python doc/print_errors.py
- name: Remove files to not upload
run: |
echo "Removing files not wanted in the uploaded artifact"
rm -rf doc/_build/html/.doctrees
# - name: Remove files to not upload
# run: |
# echo "Removing files not wanted in the uploaded artifact"
# rm -rf doc/_build/html/.doctrees

- name: Upload HTML documentation artifact
uses: actions/upload-artifact@v3
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test_wf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ jobs:
# testenv\Scripts\Activate.ps1
# .\doc\make.bat pdf

# TODO: update upload action once path exclusion is implemented (if ever)
# see https://github.com/actions/upload-pages-artifact/issues/33
- name: Remove files to not upload
run: |
echo "Removing files not wanted in the uploaded artifact"
Remove-Item doc/_build/html/.doctrees -Recurse -Force
# # TODO: update upload action once path exclusion is implemented (if ever)
# # see https://github.com/actions/upload-pages-artifact/issues/33
# - name: Remove files to not upload
# run: |
# echo "Removing files not wanted in the uploaded artifact"
# Remove-Item doc/_build/html/.doctrees -Recurse -Force

- name: Upload HTML documentation artifact
uses: actions/upload-artifact@v3
Expand Down
9 changes: 9 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from docutils.parsers.rst import Directive
from docutils import nodes
from sphinx import addnodes
from sphinx.util import rmtree


# <-----------------Override the sphinx pdf builder---------------->
# Some pages do not render properly as per the expected Sphinx LaTeX PDF signature.
Expand Down Expand Up @@ -70,9 +72,16 @@ def autodoc_skip_member(app, what, name, obj, skip, options):
# return True if exclude else None


def remove_doctree(app, exception):
"""Remove the .doctree directory created during the documentation build.
"""
rmtree(app.doctreedir)


def setup(app):
app.add_directive('pprint', PrettyPrintDirective)
app.connect('autodoc-skip-member', autodoc_skip_member)
app.connect('build-finished', remove_doctree)


local_path = os.path.dirname(os.path.realpath(__file__))
Expand Down

0 comments on commit 883aa2a

Please sign in to comment.