Skip to content

Commit 17a6733

Browse files
fix: remove obsolete update_current_project function and --project flag reference (#310)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Paul Hernandez <[email protected]>
1 parent 3e168b9 commit 17a6733

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/basic_memory/config.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def get_project_config(project_name: Optional[str] = None) -> ProjectConfig:
310310
os_project_name = os.environ.get("BASIC_MEMORY_PROJECT", None)
311311
if os_project_name: # pragma: no cover
312312
logger.warning(
313-
f"BASIC_MEMORY_PROJECT is not supported anymore. Use the --project flag or set the default project in the config instead. Setting default project to {os_project_name}"
313+
f"BASIC_MEMORY_PROJECT is not supported anymore. Set the default project in the config instead. Setting default project to {os_project_name}"
314314
)
315315
actual_project_name = project_name
316316
# if the project_name is passed in, use it
@@ -341,13 +341,6 @@ def save_basic_memory_config(file_path: Path, config: BasicMemoryConfig) -> None
341341
logger.error(f"Failed to save config: {e}")
342342

343343

344-
def update_current_project(project_name: str) -> None:
345-
"""Update the global config to use a different project.
346-
347-
This is used by the CLI when --project flag is specified.
348-
"""
349-
global config
350-
config = get_project_config(project_name) # pragma: no cover
351344

352345

353346
# setup logging to a single log file in user home directory

tests/sync/test_sync_service.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Test general sync behavior."""
22

33
import asyncio
4+
import os
45
from datetime import datetime, timezone
56
from pathlib import Path
67
from textwrap import dedent
@@ -637,8 +638,10 @@ async def test_sync_preserves_timestamps(
637638
entity_created_epoch = file_entity.created_at.timestamp()
638639
entity_updated_epoch = file_entity.updated_at.timestamp()
639640

640-
assert abs(entity_created_epoch - file_stats.st_ctime) < 1
641-
assert abs(entity_updated_epoch - file_stats.st_mtime) < 1 # Allow 1s difference
641+
# Allow 2s difference on Windows due to filesystem timing precision
642+
tolerance = 2 if os.name == 'nt' else 1
643+
assert abs(entity_created_epoch - file_stats.st_ctime) < tolerance
644+
assert abs(entity_updated_epoch - file_stats.st_mtime) < tolerance # Allow tolerance difference
642645

643646

644647
@pytest.mark.asyncio

0 commit comments

Comments
 (0)