83 lines
1.9 KiB
Python
Executable File
83 lines
1.9 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
"""Validate project setup for v0.1.0."""
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
# Add src to path
|
|
sys.path.insert(0, str(Path(__file__).parent.parent))
|
|
|
|
from src.core.constants import PATHS
|
|
from src.core.enums import PatternType, Grade, SetupType
|
|
from src.core.exceptions import ICTTradingException, DataError
|
|
from src.logging import get_logger
|
|
from src.config import load_config
|
|
|
|
|
|
def validate_imports():
|
|
"""Validate that all core imports work."""
|
|
print("✓ Core imports successful")
|
|
|
|
|
|
def validate_logging():
|
|
"""Validate logging system."""
|
|
logger = get_logger(__name__)
|
|
logger.info("Test log message")
|
|
print("✓ Logging system working")
|
|
|
|
|
|
def validate_config():
|
|
"""Validate configuration loading."""
|
|
config = load_config()
|
|
assert "app" in config
|
|
assert "trading" in config
|
|
print("✓ Configuration loading working")
|
|
|
|
|
|
def validate_directories():
|
|
"""Validate directory structure."""
|
|
required_dirs = [
|
|
"src/core",
|
|
"src/config",
|
|
"src/logging",
|
|
"config",
|
|
"tests",
|
|
"logs",
|
|
]
|
|
|
|
for dir_name in required_dirs:
|
|
dir_path = Path(dir_name)
|
|
if not dir_path.exists():
|
|
print(f"✗ Missing directory: {dir_name}")
|
|
return False
|
|
|
|
print("✓ Directory structure valid")
|
|
return True
|
|
|
|
|
|
def main():
|
|
"""Run all validation checks."""
|
|
print("Validating ICT ML Trading System v0.1.0 setup...")
|
|
print("-" * 50)
|
|
|
|
try:
|
|
validate_imports()
|
|
validate_logging()
|
|
validate_config()
|
|
validate_directories()
|
|
|
|
print("-" * 50)
|
|
print("✓ All validations passed!")
|
|
return 0
|
|
|
|
except Exception as e:
|
|
print(f"✗ Validation failed: {e}")
|
|
import traceback
|
|
traceback.print_exc()
|
|
return 1
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|
|
|