From 97812b96b1b186e1cb392dbacea7e1e197edd2ff Mon Sep 17 00:00:00 2001 From: Carson-Shaar Date: Sat, 21 Dec 2024 16:45:16 -0500 Subject: [PATCH] fix: Include docs files for copilot in package --- MANIFEST.in | 1 + copilot/copilot.py | 3 ++- mintlify-docs/__init__.py | 0 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 mintlify-docs/__init__.py diff --git a/MANIFEST.in b/MANIFEST.in index 2bccc21e..9ce91acf 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,7 @@ recursive-include zt_backend/dist_dev * recursive-include zt_backend/dist_app * recursive-include copilot/node_modules * +recursive-include mintlify-docs/Components * include copilot/client.js include zt_cli/log_config.yaml include zt_dev_cli/log_config.yaml \ No newline at end of file diff --git a/copilot/copilot.py b/copilot/copilot.py index cc1577cd..42170877 100644 --- a/copilot/copilot.py +++ b/copilot/copilot.py @@ -14,6 +14,7 @@ import traceback from copilot.context_extractor import MdxComponentParser from zt_backend.config import settings +import importlib.resources copilot_app = FastAPI() @@ -30,7 +31,7 @@ copilot_enabled = False copilot_doc_open = False version = 0 -MDX_DIRECTORY = os.path.join(settings.zt_path, 'mintlify-docs', 'Components') +MDX_DIRECTORY = importlib.resources.files("mintlify-docs") / "Components" mdx_parser = MdxComponentParser(MDX_DIRECTORY) def is_docker(): diff --git a/mintlify-docs/__init__.py b/mintlify-docs/__init__.py new file mode 100644 index 00000000..e69de29b