-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvalidator.py
More file actions
77 lines (58 loc) · 2.04 KB
/
validator.py
File metadata and controls
77 lines (58 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env python3
"""
Setup Validator module for GNN Processing Pipeline.
This module provides setup validation capabilities.
"""
import logging
from typing import Any, Dict
logger = logging.getLogger(__name__)
def validate_system() -> Dict[str, Any]:
"""
Validate the system requirements for GNN with UV support.
Returns:
Dictionary with system validation results
"""
try:
from .uv_management import check_system_requirements, check_uv_availability
return {
"success": check_system_requirements() and check_uv_availability(),
"message": "System validation completed with UV support",
}
except Exception as e:
return {"success": False, "error": str(e), "error_type": type(e).__name__}
def get_environment_info() -> Dict[str, Any]:
"""
Get comprehensive environment information.
Returns:
Dictionary with environment information
"""
try:
from .uv_management import get_installed_package_versions, get_uv_setup_info
uv_info = get_uv_setup_info()
package_versions = get_installed_package_versions()
return {
"uv_info": uv_info,
"package_versions": package_versions,
"status": "healthy",
}
except Exception as e:
logger.error(f"Failed to get environment info: {e}")
return {"error": str(e), "status": "error"}
def get_uv_status() -> Dict[str, Any]:
"""
Get UV status and configuration.
Returns:
Dictionary with UV status information
"""
try:
from .uv_management import check_uv_availability, get_uv_setup_info
uv_available = check_uv_availability()
uv_info = get_uv_setup_info()
return {
"uv_available": uv_available,
"uv_info": uv_info,
"status": "healthy" if uv_available else "unavailable",
}
except Exception as e:
logger.error(f"Failed to get UV status: {e}")
return {"uv_available": False, "error": str(e), "status": "error"}