diff --git a/sdk/pyproject.toml b/sdk/pyproject.toml index cec2bdeb2..2c906cce0 100644 --- a/sdk/pyproject.toml +++ b/sdk/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "beta9" -version = "0.1.141" +version = "0.1.142" description = "" authors = ["beam.cloud "] packages = [ diff --git a/sdk/src/beta9/sync.py b/sdk/src/beta9/sync.py index 4c2f8a843..fa7c2840b 100644 --- a/sdk/src/beta9/sync.py +++ b/sdk/src/beta9/sync.py @@ -24,7 +24,6 @@ from .config import get_settings from .env import is_local -_settings = get_settings() _sync_lock = threading.Lock() # Global workspace object id to signal to any other threads that the workspace has already been synced @@ -44,9 +43,15 @@ def get_workspace_object_id() -> str: CHUNK_SIZE = 1024 * 1024 * 4 -IGNORE_FILE_NAME = f".{_settings.name}ignore".lower() -IGNORE_FILE_CONTENTS = f"""# Generated by {_settings.name} SDK -.{_settings.name.lower()}ignore + + +def ignore_file_name() -> str: + return f".{get_settings().name}ignore".lower() + + +def ignore_file_contents() -> str: + return f"""# Generated by {get_settings().name} SDK +.{get_settings().name.lower()}ignore pyproject.toml .git .idea @@ -93,7 +98,7 @@ def __init__( @property def ignore_file_path(self) -> Path: - return self.root_dir / IGNORE_FILE_NAME + return self.root_dir / ignore_file_name() def _init_ignore_file(self) -> None: if not is_local(): @@ -102,15 +107,15 @@ def _init_ignore_file(self) -> None: if self.ignore_file_path.exists(): return - terminal.detail(f"Writing {IGNORE_FILE_NAME} file") + terminal.detail(f"Writing {ignore_file_name()} file") with self.ignore_file_path.open(mode="w") as f: - f.writelines(IGNORE_FILE_CONTENTS) + f.writelines(ignore_file_contents()) def _read_ignore_file(self) -> list: if not is_local(): return [] - terminal.detail(f"Reading {IGNORE_FILE_NAME} file") + terminal.detail(f"Reading {ignore_file_name()} file") patterns = []