-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup_dev.py
More file actions
66 lines (51 loc) · 2.23 KB
/
setup_dev.py
File metadata and controls
66 lines (51 loc) · 2.23 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
#!/usr/bin/env python3
"""
Development setup script for llm-data-converter.
"""
import subprocess
import sys
import os
def run_command(command, description):
"""Run a command and handle errors."""
print(f"🔄 {description}...")
try:
result = subprocess.run(command, shell=True, check=True, capture_output=True, text=True)
print(f"✅ {description} completed successfully")
return True
except subprocess.CalledProcessError as e:
print(f"❌ {description} failed: {e}")
print(f"Error output: {e.stderr}")
return False
def main():
"""Main setup function."""
print("🚀 Setting up llm-data-converter development environment...\n")
# Check Python version
if sys.version_info < (3, 8):
print("❌ Python 3.8 or higher is required")
sys.exit(1)
print(f"✅ Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro} detected")
# Install dependencies
print("\n📦 Installing dependencies...")
# Install base dependencies
if not run_command("pip install -e .", "Installing package in development mode"):
print("❌ Failed to install package")
sys.exit(1)
# Install development dependencies
if not run_command("pip install -e .[dev]", "Installing development dependencies"):
print("⚠️ Failed to install development dependencies (continuing anyway)")
# Run tests
print("\n🧪 Running tests...")
if not run_command("python -m pytest tests/ -v", "Running tests"):
print("⚠️ Some tests failed (this might be expected for first run)")
# Run example
print("\n📝 Running basic example...")
if not run_command("python examples/basic_usage.py", "Running basic usage example"):
print("⚠️ Example failed (this might be expected for first run)")
print("\n🎉 Setup completed!")
print("\n📚 Next steps:")
print("1. Check out the examples/ directory for usage examples")
print("2. Run 'python -m pytest tests/' to run all tests")
print("3. Run 'python examples/basic_usage.py' to see the library in action")
print("4. Check the README.md for detailed documentation")
if __name__ == "__main__":
main()