diff --git a/docs/conf.py b/docs/conf.py index f8280af35..ff2b206ec 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -9,12 +9,8 @@ from sphinx.util import logging # Disable import of swiftest._bindings so that we don't have to build the Fortran code when building the docs +import swiftest autodoc_mock_imports = ['swiftest._bindings'] -# Check if we are building on Read the Docs -on_rtd = os.environ.get('READTHEDOCS') == 'True' - -if not on_rtd: - import swiftest # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information @@ -171,7 +167,7 @@ def linkcode_resolve(domain, info): else: linespec = "" - fn = os.path.relpath(fn, start=os.path.dirname()) + fn = os.path.relpath(fn, start=os.path.dirname(swiftest.__file__))