Skip to content

Commit

Permalink
removes generate_apidocs in doc/conf.py to solve duplication calls an…
Browse files Browse the repository at this point in the history
…d correct path doc/conf.py in .readthedocs.yaml (#115)
  • Loading branch information
mxochicale committed Jun 22, 2023
1 parent 0f34af6 commit f3d9e6b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build:
# Build documentation in the docs/ directory with Sphinx
sphinx:
builder: html
configuration: docs/conf.py
configuration: doc/conf.py
fail_on_warning: false

# Optionally declare the Python requirements required to build your docs
Expand Down
21 changes: 0 additions & 21 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,6 @@
html_static_path = [static_folder]


def generate_apidocs(*args):
"""Generate API docs automatically by trawling the available modules"""

global working_dir, module_path
output_path = working_dir
apidoc_command_path = 'sphinx-apidoc'
if hasattr(sys, 'real_prefix'): # called from a virtualenv
apidoc_command_path = os.path.join(sys.prefix, 'bin', 'sphinx-apidoc')
apidoc_command_path = os.path.abspath(apidoc_command_path)
subprocess.check_call(
[apidoc_command_path, '--force', '--separate'] +
['-o', output_path, module_path] +
[os.path.join(root_dir_abs, pattern) for pattern in exclude_patterns])


def setup(app):
# Hook to allow for automatic generation of API docs
# before doc deployment begins.
app.connect('builder-inited', generate_apidocs)


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down

0 comments on commit f3d9e6b

Please sign in to comment.