Remove check_for_deprecated_env
This commit is contained in:
parent
54fa3de2da
commit
c495a778e1
2 changed files with 0 additions and 18 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from haiku.rag.config.loader import (
|
from haiku.rag.config.loader import (
|
||||||
check_for_deprecated_env,
|
|
||||||
find_config_file,
|
find_config_file,
|
||||||
generate_default_config,
|
generate_default_config,
|
||||||
load_config_from_env,
|
load_config_from_env,
|
||||||
|
|
@ -49,6 +48,3 @@ if config_path:
|
||||||
Config = AppConfig.model_validate(yaml_data)
|
Config = AppConfig.model_validate(yaml_data)
|
||||||
else:
|
else:
|
||||||
Config = AppConfig()
|
Config = AppConfig()
|
||||||
|
|
||||||
# Check for deprecated .env file
|
|
||||||
check_for_deprecated_env()
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
import os
|
import os
|
||||||
import warnings
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
import yaml
|
import yaml
|
||||||
|
|
@ -45,19 +44,6 @@ def load_yaml_config(path: Path) -> dict:
|
||||||
return data or {}
|
return data or {}
|
||||||
|
|
||||||
|
|
||||||
def check_for_deprecated_env() -> None:
|
|
||||||
"""Check for .env file and warn if found."""
|
|
||||||
env_file = Path.cwd() / ".env"
|
|
||||||
if env_file.exists():
|
|
||||||
warnings.warn(
|
|
||||||
".env file detected but YAML configuration is now preferred. "
|
|
||||||
"Environment variable configuration is deprecated and will be removed in future versions."
|
|
||||||
"Run 'haiku-rag init-config' to generate a YAML config file.",
|
|
||||||
DeprecationWarning,
|
|
||||||
stacklevel=2,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def generate_default_config() -> dict:
|
def generate_default_config() -> dict:
|
||||||
"""Generate a default YAML config structure with documentation."""
|
"""Generate a default YAML config structure with documentation."""
|
||||||
return {
|
return {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue