Repository navigation
Expand file tree
/
Copy pathsetup.command
More file actions
executable file
·73 lines (64 loc) · 2.38 KB
/
Copy pathsetup.command
File metadata and controls
executable file
·73 lines (64 loc) · 2.38 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
#!/bin/bash
# setup.command — First-run setup for EaglePlot (macOS)
# Double-click this file in Finder to create the virtual environment
# and install all dependencies.
cd "$(dirname "$0")"
echo "=== EaglePlot Setup ==="
echo
# ── Check Python 3 is available ──────────────────────────────────────────────
if ! command -v python3 &>/dev/null; then
echo "ERROR: python3 was not found."
echo "Please install Python 3.9 or later from https://www.python.org/downloads/"
echo
read -r -p "Press Enter to close..."
exit 1
fi
# ── Check the Python version (pyproject.toml: >=3.9, !=3.9.7) ─────────────────
if ! python3 -c 'import sys; v = sys.version_info[:3]; sys.exit(0 if v >= (3, 9) and v != (3, 9, 7) else 1)'; then
echo "ERROR: EaglePlot needs Python 3.9 or later (but not 3.9.7)."
echo "Found: $(python3 --version 2>&1)"
echo "Install a newer Python from https://www.python.org/downloads/"
echo
read -r -p "Press Enter to close..."
exit 1
fi
# ── Create virtual environment (skip if already exists) ──────────────────────
if [ -d ".venv" ]; then
echo "Virtual environment already exists -- skipping creation."
else
echo "Creating virtual environment..."
python3 -m venv .venv
if [ $? -ne 0 ]; then
echo "ERROR: Could not create virtual environment."
echo "Make sure Python 3.9 or later is installed."
echo
read -r -p "Press Enter to close..."
exit 1
fi
echo "Done."
fi
echo
echo "Installing dependencies (this may take a few minutes on first run)..."
echo
if ! source .venv/bin/activate; then
echo "ERROR: Could not activate .venv. Delete the .venv folder and run setup again."
echo
read -r -p "Press Enter to close..."
exit 1
fi
pip install -e ".[formats,nist]"
if [ $? -ne 0 ]; then
echo
echo "ERROR: Dependency installation failed."
echo "Check the output above for details."
echo
read -r -p "Press Enter to close..."
exit 1
fi
echo
echo "============================================================"
echo " Setup complete!"
echo " Double-click launch.command to start EaglePlot."
echo "============================================================"
echo
read -r -p "Press Enter to close..."