-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquickstart.sh
More file actions
executable file
·68 lines (55 loc) · 2.68 KB
/
Copy pathquickstart.sh
File metadata and controls
executable file
·68 lines (55 loc) · 2.68 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
#!/bin/bash
# quickstart.sh - Setup script for AMM-Algorithms development
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
BOLD='\033[1m'
NC='\033[0m'
# Get project root
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$PROJECT_ROOT"
echo -e "${CYAN}${BOLD}╔════════════════════════════════════════════════════════════╗${NC}"
echo -e "${CYAN}${BOLD}║ SAGE AMMs Development Setup ║${NC}"
echo -e "${CYAN}${BOLD}╚════════════════════════════════════════════════════════════╝${NC}"
echo ""
# Step 1: Install Git Hooks
echo -e "${YELLOW}${BOLD}Step 1: Installing Git Hooks${NC}"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
HOOKS_DIR="$PROJECT_ROOT/.git/hooks"
TEMPLATE_DIR="$PROJECT_ROOT/hooks"
if [ ! -d "$HOOKS_DIR" ]; then
echo -e "${RED}✗ Git repository not initialized${NC}"
echo -e "${YELLOW}Run: git init${NC}"
exit 1
fi
if [ -d "$TEMPLATE_DIR" ]; then
for hook in pre-commit pre-push post-commit; do
if [ -f "$TEMPLATE_DIR/$hook" ]; then
cp "$TEMPLATE_DIR/$hook" "$HOOKS_DIR/$hook"
chmod +x "$HOOKS_DIR/$hook"
echo -e "${GREEN}✓ Installed $hook hook${NC}"
fi
done
else
echo -e "${YELLOW}⚠ No hooks directory found, skipping...${NC}"
fi
echo ""
# Step 2: Install in development mode
echo -e "${YELLOW}${BOLD}Step 2: Installing isage-amms in development mode${NC}"
echo -e "${CYAN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
echo -e "${CYAN}Auto build mode enabled (memory probe in setup.py)${NC}"
echo -e "${CYAN}Overrides: AMMS_LOW_MEMORY_BUILD=0|1, AMMS_FAST_BUILD=0|1, AMMS_MAX_JOBS=N, AMMS_FAST_BUILD_MEMORY_GB=48${NC}"
pip install -e .
echo ""
echo -e "${GREEN}${BOLD}✓ Setup complete!${NC}"
echo ""
echo -e "${CYAN}Next steps:${NC}"
echo -e " ${GREEN}1.${NC} Make changes to the code"
echo -e " ${GREEN}2.${NC} Run tests: ${YELLOW}pytest tests/${NC}"
echo -e " ${GREEN}3.${NC} Commit changes: ${YELLOW}git add . && git commit -m 'your message'${NC}"
echo -e " ${GREEN}4.${NC} Push to GitHub: ${YELLOW}git push${NC} (pre-push hook will check version)"
echo ""