-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup_dev.sh
More file actions
executable file
·82 lines (66 loc) · 1.79 KB
/
setup_dev.sh
File metadata and controls
executable file
·82 lines (66 loc) · 1.79 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
78
79
80
81
82
#!/bin/bash
# Development setup script for Trusera SDK
set -e
echo "=== Trusera SDK Development Setup ==="
echo ""
# Check Python version
PYTHON_VERSION=$(python3 --version 2>&1 | awk '{print $2}')
echo "Python version: $PYTHON_VERSION"
REQUIRED_VERSION="3.9"
if ! python3 -c "import sys; exit(0 if sys.version_info >= (3, 9) else 1)"; then
echo "Error: Python 3.9+ required"
exit 1
fi
echo "✓ Python version OK"
echo ""
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
echo "Creating virtual environment..."
python3 -m venv venv
echo "✓ Virtual environment created"
else
echo "✓ Virtual environment exists"
fi
echo ""
# Activate virtual environment
echo "Activating virtual environment..."
source venv/bin/activate
echo "✓ Virtual environment activated"
echo ""
# Upgrade pip
echo "Upgrading pip..."
pip install --upgrade pip > /dev/null 2>&1
echo "✓ pip upgraded"
echo ""
# Install package in development mode
echo "Installing trusera-sdk in development mode..."
pip install -e ".[dev,langchain,crewai,autogen]" > /dev/null 2>&1
echo "✓ Package installed"
echo ""
# Run tests
echo "Running tests..."
pytest -v --tb=short
echo ""
# Run linter
echo "Running linter..."
ruff check .
echo "✓ Linting passed"
echo ""
# Run type checker
echo "Running type checker..."
mypy trusera_sdk
echo "✓ Type checking passed"
echo ""
echo "=== Setup Complete ==="
echo ""
echo "Virtual environment is activated. To deactivate, run: deactivate"
echo ""
echo "Available commands:"
echo " make test - Run tests"
echo " make lint - Run linter"
echo " make type-check - Run type checker"
echo " make all - Run all checks"
echo " make build - Build package"
echo ""
echo "To activate the venv in the future:"
echo " source venv/bin/activate"