mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
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 <phernandez@users.noreply.github.com>
This commit is contained in:
@@ -310,7 +310,7 @@ def get_project_config(project_name: Optional[str] = None) -> ProjectConfig:
|
||||
os_project_name = os.environ.get("BASIC_MEMORY_PROJECT", None)
|
||||
if os_project_name: # pragma: no cover
|
||||
logger.warning(
|
||||
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}"
|
||||
f"BASIC_MEMORY_PROJECT is not supported anymore. Set the default project in the config instead. Setting default project to {os_project_name}"
|
||||
)
|
||||
actual_project_name = project_name
|
||||
# if the project_name is passed in, use it
|
||||
@@ -341,13 +341,6 @@ def save_basic_memory_config(file_path: Path, config: BasicMemoryConfig) -> None
|
||||
logger.error(f"Failed to save config: {e}")
|
||||
|
||||
|
||||
def update_current_project(project_name: str) -> None:
|
||||
"""Update the global config to use a different project.
|
||||
|
||||
This is used by the CLI when --project flag is specified.
|
||||
"""
|
||||
global config
|
||||
config = get_project_config(project_name) # pragma: no cover
|
||||
|
||||
|
||||
# setup logging to a single log file in user home directory
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Test general sync behavior."""
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
from textwrap import dedent
|
||||
@@ -637,8 +638,10 @@ Testing file timestamps
|
||||
entity_created_epoch = file_entity.created_at.timestamp()
|
||||
entity_updated_epoch = file_entity.updated_at.timestamp()
|
||||
|
||||
assert abs(entity_created_epoch - file_stats.st_ctime) < 1
|
||||
assert abs(entity_updated_epoch - file_stats.st_mtime) < 1 # Allow 1s difference
|
||||
# Allow 2s difference on Windows due to filesystem timing precision
|
||||
tolerance = 2 if os.name == 'nt' else 1
|
||||
assert abs(entity_created_epoch - file_stats.st_ctime) < tolerance
|
||||
assert abs(entity_updated_epoch - file_stats.st_mtime) < tolerance # Allow tolerance difference
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
|
||||
Reference in New Issue
Block a user