Skip to content

Commit

Permalink
alternate change
Browse files Browse the repository at this point in the history
  • Loading branch information
dleviminzi committed Dec 31, 2024
1 parent bc1a50e commit ef6c481
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sdk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "beta9"
version = "0.1.141"
version = "0.1.142"
description = ""
authors = ["beam.cloud <[email protected]>"]
packages = [
Expand Down
21 changes: 13 additions & 8 deletions sdk/src/beta9/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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():
Expand All @@ -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 = []

Expand Down

0 comments on commit ef6c481

Please sign in to comment.