Skip to content

Commit

Permalink
removed setup() usage from builder.py, it's now called from conf.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ZergLev committed Oct 11, 2024
1 parent 3061a1c commit 48156fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def replace(v: Any) -> str:

with open(links_file, "w") as file:
file.write(contents)

"""
# Importing version-dependent module setup.py
# TODO: import setup() from older conf.py files directly.
# Maybe if the import is unsuccessful import from the other location?
Expand All @@ -114,13 +114,13 @@ def replace(v: Any) -> str:
setup_module = importlib.util.module_from_spec(spec)
sys.modules["setup"] = setup_module
spec.loader.exec_module(setup_module)

"""
# Cleaning outdated documentation build
clean_docs(str(output_dir))

# Running Chatsky custom funcs before doc building
scripts.doc.pre_sphinx_build_funcs(str(root_dir))
setup_module.setup(str(root_dir))
# setup_module.setup(str(root_dir))

# Using the newest conf.py file instead of the old one
# This feature can be turned on, in case anyone needs it to build old versions with newer links / design.
Expand Down
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ def setup(_):
sys.modules["setup"] = setup_module
spec.loader.exec_module(setup_module)
setup_module.setup(str(root_dir))
# Or this could just be
# from old_conf import setup
# setup()
else:
from setup import setup
setup()

0 comments on commit 48156fa

Please sign in to comment.