-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-setup.sh
More file actions
executable file
·81 lines (69 loc) · 2.18 KB
/
dev-setup.sh
File metadata and controls
executable file
·81 lines (69 loc) · 2.18 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
#!/bin/bash
#
# Development environment setup script for claude-pace-maker
# Run this after freshly cloning the repository
#
set -e
# Color codes
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "Setting up claude-pace-maker development environment..."
echo ""
# Check Python version
echo "Checking Python version..."
PYTHON_VERSION=$(python3 --version 2>&1 | awk '{print $2}')
echo -e "${GREEN}✓ Python $PYTHON_VERSION${NC}"
echo ""
# Install development dependencies
echo "Installing development dependencies..."
if pip3 install --user black ruff mypy pytest pytest-cov 2>&1 | tail -1; then
echo -e "${GREEN}✓ Development dependencies installed${NC}"
else
echo -e "${RED}✗ Failed to install dependencies${NC}"
exit 1
fi
echo ""
# Install pre-commit hook
echo "Installing pre-commit hook..."
if [ -f ".git/hooks/pre-commit" ]; then
echo -e "${YELLOW}⚠ Pre-commit hook already exists, backing up...${NC}"
mv .git/hooks/pre-commit .git/hooks/pre-commit.backup
fi
cp lint.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
echo -e "${GREEN}✓ Pre-commit hook installed${NC}"
echo ""
# Make lint.sh executable
chmod +x lint.sh
echo -e "${GREEN}✓ Made lint.sh executable${NC}"
echo ""
# Run tests to verify setup
echo "Running tests to verify setup..."
if python3 -m pytest tests/ -q 2>&1 | tail -5; then
echo -e "${GREEN}✓ Tests passing${NC}"
else
echo -e "${YELLOW}⚠ Some tests may be failing (this is OK for initial setup)${NC}"
fi
echo ""
# Run linters to check code quality
echo "Running linters..."
if ./lint.sh; then
echo -e "${GREEN}✓ All linters passed${NC}"
else
echo -e "${YELLOW}⚠ Linting issues found - run './lint.sh' to see details${NC}"
fi
echo ""
echo -e "${GREEN}========================================${NC}"
echo -e "${GREEN}Development environment setup complete!${NC}"
echo -e "${GREEN}========================================${NC}"
echo ""
echo "Next steps:"
echo " 1. Run tests: python3 -m pytest tests/"
echo " 2. Run linters: ./lint.sh"
echo " 3. Install: ./install.sh"
echo " 4. Check status: pace-maker status"
echo ""