-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·83 lines (71 loc) · 2.56 KB
/
install.sh
File metadata and controls
executable file
·83 lines (71 loc) · 2.56 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
83
#!/bin/bash
set -e
REPO_URL="https://github.com/simplito/deepfellow-cli.git"
MIN_PYTHON_VERSION="3.10"
echo "Installing deepfellow..."
# Function to check Python version
check_python_version() {
local python_cmd=$1
if command -v "$python_cmd" &> /dev/null; then
local version=$("$python_cmd" -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
if [ "$(printf '%s\n' "$MIN_PYTHON_VERSION" "$version" | sort -V | head -n1)" = "$MIN_PYTHON_VERSION" ]; then
echo "$version"
return 0
fi
fi
return 1
}
# Check for Python 3.10+
PYTHON_VERSION=""
for cmd in python3 python; do
if PYTHON_VERSION=$(check_python_version "$cmd"); then
echo "✓ Found Python $PYTHON_VERSION"
break
fi
done
if [ -z "$PYTHON_VERSION" ]; then
echo "Error: Python $MIN_PYTHON_VERSION or higher is required."
echo "Please install Python from https://www.python.org/downloads/"
exit 1
fi
if command -v uv &> /dev/null; then
echo "Using uv tool install..."
uv tool install "git+$REPO_URL"
elif command -v pipx &> /dev/null; then
echo "Using pipx..."
pipx install "git+$REPO_URL"
elif command -v pip3 &> /dev/null; then
echo "Using pip3..."
if ! pip3 install --user "git+$REPO_URL" 2>/dev/null; then
echo ""
echo "⚠ Your system uses PEP 668 protection (externally-managed-environment)."
echo "This prevents pip from installing packages globally."
echo ""
read -p "Install with --break-system-packages? [y/N] " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
pip3 install --user --break-system-packages "git+$REPO_URL"
else
echo "Installation cancelled. Consider installing uv or pipx first."
exit 1
fi
fi
elif command -v pip &> /dev/null; then
echo "Using pip..."
if ! pip install --user "git+$REPO_URL" 2>/dev/null; then
echo ""
echo "⚠ Your system uses PEP 668 protection (externally-managed-environment)."
echo "This prevents pip from installing packages globally."
echo ""
read -p "Install with --break-system-packages? [y/N] " confirm
if [[ "$confirm" =~ ^[Yy]$ ]]; then
pip install --user --break-system-packages "git+$REPO_URL"
else
echo "Installation cancelled. Consider installing uv or pipx first."
exit 1
fi
fi
else
echo "Error: No package manager found. Please install Python package manager first (uv / pipx / pip3 / pip)."
exit 1
fi
echo "✅ Installed successfully!"