diff options
-rw-r--r-- | .github/workflows/main.yaml | 2 | ||||
-rw-r--r-- | continuedev/src/continuedev/core/sdk.py | 54 |
2 files changed, 1 insertions, 55 deletions
diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 365f7b7d..1309aa24 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -31,7 +31,7 @@ jobs: run: | pip install -r continuedev/requirements.txt - - run: pyinstaller run.py --exclude-module numpy --exclude-module jedi -F + - run: pyinstaller run.py --exclude-module numpy --exclude-module jedi -F --add-data 'continuedev:continuedev' --hidden-import=anthropic --hidden-import=github - name: Set permissions run: | diff --git a/continuedev/src/continuedev/core/sdk.py b/continuedev/src/continuedev/core/sdk.py index d040ea41..5065ff88 100644 --- a/continuedev/src/continuedev/core/sdk.py +++ b/continuedev/src/continuedev/core/sdk.py @@ -18,7 +18,6 @@ from ..libs.util.telemetry import posthog_logger from ..libs.util.paths import getConfigFilePath from .models import Models from ..libs.util.logging import logger -# __import__("anthropic", globals(), locals(), ["AsyncAnthropic"], 0) class Autopilot: @@ -166,59 +165,6 @@ class ContinueSDK(AbstractContinueSDK): _last_valid_config: ContinueConfig = None def _load_config_dot_py(self) -> ContinueConfig: - # Read the file content - with open(os.path.expanduser('~/.continue/config.py')) as file: - config_content = file.read() - - def load_module(module_name: str, class_names: List[str]): - # from anthropic import AsyncAnthropic - print("IMPORTING") - # exec("from anthropic import AsyncAnthropic", globals(), locals()) - # imports = __import__("anthropic", globals(), locals(), ["AsyncAnthropic"], 0) - # print("IMPORTS: ", imports) - # for class_name in class_names: - # globals()[class_name] = getattr(imports, class_name) - # module = importlib.import_module(module_name) - # for class_name in class_names: - # globals()[class_name] = getattr(module, class_name) - - while True: - # Execute the file content - locals_var = {} - try: - import importlib.util - spec = importlib.util.spec_from_file_location( - "config", "/Users/natesesti/.continue/config.py") - config = importlib.util.module_from_spec(spec) - spec.loader.exec_module(config) - - return config.config - # exec(config_content, globals(), locals_var) - # print("Done executing, ", locals_var) - # return locals_var['config'] - except ModuleNotFoundError as e: - print("ModuleNotFoundError") - print(e) - print(traceback.format_exception(e)) - formatted = traceback.format_exception(e) - line = formatted[-2].split("\n")[-2].strip().split() - # Parse the module name and class name from the error message - # Example: ModuleNotFoundError: No module named 'continuedev.src.continuedev.plugins.context_providers.google' - - # Get the module name - module_name = line[1] - # Get the class name - class_names = list(map(lambda x: x.replace( - ",", ""), filter(lambda x: x.strip() != "", line[3:]))) - - # Load the module - print( - f"Loading module {module_name} with class names {class_names}") - load_module(module_name, class_names) - except Exception as e: - print("Failed to execute config.py: ", e) - raise e - # Use importlib to load the config file config.py at the given path path = getConfigFilePath() |