mirror of
https://github.com/ShaYmez/HBMonv2.git
synced 2026-05-28 02:46:51 -04:00
Refactor install script for better dependency management
Updated install.sh to improve dependency installation and virtual environment setup.
This commit is contained in:
parent
4b7f08838e
commit
181d928969
39
install.sh
39
install.sh
@ -1,7 +1,36 @@
|
||||
#! /bin/bash
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Install the required support programs
|
||||
# Check if apt-get is available
|
||||
if ! command -v apt-get >/dev/null; then
|
||||
echo "apt-get not found. Please install dependencies manually for your OS."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure requirements.txt exists to prevent running in wrong directory
|
||||
if [ ! -f requirements.txt ]; then
|
||||
echo "requirements.txt not found! Run this script from the repository root."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Install system dependencies
|
||||
apt-get update
|
||||
apt-get install python3 python3-pip python3-dev libffi-dev libssl-dev cargo sed -y
|
||||
pip3 install --upgrade setuptools wheel --break-system-packages
|
||||
pip3 install -r requirements.txt --break-system-packages
|
||||
apt-get install -y python3 python3-pip python3-venv python3-dev libffi-dev libssl-dev cargo sed
|
||||
|
||||
# Set up Python virtual environment if not exists
|
||||
if [ ! -d ".venv" ]; then
|
||||
python3 -m venv .venv
|
||||
fi
|
||||
|
||||
# Upgrade pip and tools, then install requirements in venv
|
||||
. .venv/bin/activate
|
||||
pip install --upgrade pip setuptools wheel
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
echo ""
|
||||
echo "=============================================="
|
||||
echo "Setup complete! To activate, run:"
|
||||
echo " source .venv/bin/activate"
|
||||
echo ""
|
||||
echo "Then run your app as usual (e.g., python monitor.py/bridge.py)"
|
||||
echo "=============================================="
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user