forked from LalatenduMohanty/learning-fromager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·58 lines (47 loc) · 1.43 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·58 lines (47 loc) · 1.43 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
#!/bin/bash
# Setup script for fromager learning environment
# Created with assistance from Cursor AI and Claude-4-Sonnet
set -e
echo "=== Fromager Learning Environment Setup ==="
# Check Python version
python_version=$(python3 --version 2>&1 | grep -oE '[0-9]+\.[0-9]+')
min_version="3.11"
if [ "$(printf '%s\n' "$min_version" "$python_version" | sort -V | head -n1)" != "$min_version" ]; then
echo "Error: Python 3.11+ is required for Fromager. Found: $python_version"
echo "Please install Python 3.11 or later to use Fromager."
exit 1
fi
echo "✓ Python version check passed: $python_version"
# Create virtual environment
echo "Creating virtual environment..."
python3 -m venv fromager-env
# Activate virtual environment
echo "Activating virtual environment..."
source fromager-env/bin/activate
# Upgrade pip
echo "Upgrading pip..."
pip install --upgrade pip
# Install fromager
echo "Installing fromager..."
pip install fromager
# Verify installation
echo "Verifying installation..."
if command -v fromager &> /dev/null; then
echo "✓ Fromager installed successfully!"
fromager --version
else
echo "✗ Fromager installation failed"
exit 1
fi
echo ""
echo "=== Setup Complete! ==="
echo ""
echo "To use fromager:"
echo " source fromager-env/bin/activate"
echo " fromager --help"
echo ""
echo "To run the exercises:"
echo " cd examples/exercises"
echo " ./exercise1_beginner.sh"
echo ""
echo "Happy building! 🎉"