Spaces:
Running
Running
File size: 3,261 Bytes
c61ed6b |
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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
#!/usr/bin/env python3
"""
Test script to check for trackio package conflicts
"""
import sys
import importlib
def test_trackio_imports():
"""Test what trackio-related packages are available"""
print("π Testing Trackio Package Imports")
print("=" * 50)
# Check for trackio package
try:
trackio_module = importlib.import_module('trackio')
print(f"β
Found trackio package: {trackio_module}")
print(f" Location: {trackio_module.__file__}")
# Check for init attribute
if hasattr(trackio_module, 'init'):
print("β
trackio.init exists")
else:
print("β trackio.init does not exist")
print(f" Available attributes: {[attr for attr in dir(trackio_module) if not attr.startswith('_')]}")
except ImportError:
print("β
No trackio package found (this is good)")
# Check for our custom TrackioAPIClient
try:
sys.path.append(str(Path(__file__).parent.parent / "scripts" / "trackio_tonic"))
from trackio_api_client import TrackioAPIClient
print("β
Custom TrackioAPIClient available")
except ImportError as e:
print(f"β Custom TrackioAPIClient not available: {e}")
# Check for any other trackio-related imports
trackio_related = []
for module_name in sys.modules:
if 'trackio' in module_name.lower():
trackio_related.append(module_name)
if trackio_related:
print(f"β οΈ Found trackio-related modules: {trackio_related}")
else:
print("β
No trackio-related modules found")
def test_monitoring_import():
"""Test monitoring module import"""
print("\nπ Testing Monitoring Module Import")
print("=" * 50)
try:
sys.path.append(str(Path(__file__).parent.parent / "src"))
from monitoring import SmolLM3Monitor
print("β
SmolLM3Monitor imported successfully")
# Test monitor creation
monitor = SmolLM3Monitor("test-experiment")
print("β
Monitor created successfully")
print(f" Dataset repo: {monitor.dataset_repo}")
print(f" Enable tracking: {monitor.enable_tracking}")
except Exception as e:
print(f"β Failed to import/create monitor: {e}")
import traceback
traceback.print_exc()
def main():
"""Run trackio conflict tests"""
print("π Trackio Conflict Detection")
print("=" * 50)
tests = [
test_trackio_imports,
test_monitoring_import
]
all_passed = True
for test in tests:
try:
test()
except Exception as e:
print(f"β Test failed with error: {e}")
all_passed = False
print("\n" + "=" * 50)
if all_passed:
print("π ALL TRACKIO CONFLICT TESTS PASSED!")
print("β
No trackio package conflicts detected")
print("β
Monitoring module works correctly")
else:
print("β SOME TRACKIO CONFLICT TESTS FAILED!")
print("Please check the failed tests above.")
return all_passed
if __name__ == "__main__":
from pathlib import Path
success = main()
sys.exit(0 if success else 1) |