Skip to content

Commit 698fdd2

Browse files
committed
FIX: for building documentation for diffCheck py __init__ and sphinx conf env
1 parent a82b792 commit 698fdd2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

doc/conf.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
import sys
3939

4040
# -- Dlls/pyd imports ---------------------------------------------------------
41+
# Set the SPHINX_BUILD environment variable to not conflct with the import of
42+
# the pybind module and df_cvt_bindings from the diffCheck __init__.py
43+
os.environ['SPHINX_BUILD'] = '1'
44+
4145
# import package's modules path and dlls/pyds, checking for import of pybind module
4246
extra_dll_dir_doc = os.path.abspath('./')
4347
extra_dll_dir_pysource = os.path.abspath('./../src/gh/diffCheck')

src/gh/diffCheck/diffCheck/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
extra_dll_dir = os.path.join(os.path.dirname(__file__), PATH_TO_DLL)
88
os.add_dll_directory(extra_dll_dir)
99

10-
# import the bindings
11-
from . import diffcheck_bindings # type: ignore[attr-defined]
12-
from . import df_cvt_bindings # type: ignore[attr-defined]
10+
if not os.getenv('SPHINX_BUILD', False):
11+
from . import diffcheck_bindings # type: ignore[attr-defined]
12+
from . import df_cvt_bindings # type: ignore[attr-defined]

0 commit comments

Comments
 (0)