Skip to content

Commit

Permalink
CI: fix upload error in full documentation
Browse files Browse the repository at this point in the history
Problem
Building the full documentation with sphynx leads to the generation
of a .doctree directory. This directory is composed of a file
environment.pickle which has size > 100 Mb. Thus, the upload step of
the full documentation workflow fails due to the size of such file (git
does not allow files of > 100 Mb without using lfs).

Solution
Since the .doctree directory should not be versioned at all, we had a
build-finished event to delete to .doctree directory after the
documentation build.
  • Loading branch information
SMoraisAnsys committed Nov 6, 2023
1 parent 6ddd4b8 commit 6ea5d17
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from docutils.parsers.rst import Directive
from docutils import nodes
from sphinx import addnodes
import shutil

# <-----------------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 +71,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.
"""
shutil.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 6ea5d17

Please sign in to comment.