-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
64 lines (51 loc) · 2.08 KB
/
Copy pathsetup.py
File metadata and controls
64 lines (51 loc) · 2.08 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
#!/usr/bin/env python3
"""Setup script for A2A Python SDK development."""
import subprocess
import sys
import os
def run_command(command, description):
"""Run a command and handle errors."""
print(f"\n{description}...")
try:
result = subprocess.run(command, shell=True, check=True, capture_output=True, text=True)
print(f"✓ {description} completed successfully")
if result.stdout:
print(result.stdout)
return True
except subprocess.CalledProcessError as e:
print(f"✗ {description} failed")
print(f"Error: {e.stderr}")
return False
def main():
"""Main setup function."""
print("A2A Python SDK Development Setup")
print("=" * 40)
# Check Python version
if sys.version_info < (3, 8):
print("Error: Python 3.8 or higher is required")
sys.exit(1)
print(f"✓ Python {sys.version_info.major}.{sys.version_info.minor} detected")
# Install dependencies
if not run_command("pip install -r requirements.txt", "Installing dependencies"):
print("Failed to install dependencies. Please install manually:")
print("pip install -r requirements.txt")
sys.exit(1)
# Install package in development mode
if not run_command("pip install -e .", "Installing package in development mode"):
print("Failed to install package in development mode")
sys.exit(1)
# Run tests
if not run_command("python -m pytest tests/ -v", "Running tests"):
print("Some tests failed. Please check the output above.")
print("\n" + "=" * 40)
print("Setup completed!")
print("\nNext steps:")
print("1. Start the echo agent: python samples/echo_agent/main.py")
print("2. In another terminal, run the client: python samples/client_examples/basic_client.py")
print("3. Visit http://localhost:8000/echo/card to see the agent card")
print("\nFor development:")
print("- Run tests: pytest")
print("- Format code: black src/ tests/")
print("- Type check: mypy src/")
if __name__ == "__main__":
main()