From a76c17bb02e40b6791bfbf53cef8b407dc9501e5 Mon Sep 17 00:00:00 2001 From: agessaman Date: Mon, 16 Mar 2026 20:51:22 -0700 Subject: [PATCH] Update .gitignore and enhance install-service.sh for virtual environment management - Added patterns to .gitignore to exclude log files and local configuration files. - Improved the install-service.sh script to verify the integrity of the virtual environment and ensure pip is available and up to date before installing dependencies. --- .gitignore | 2 ++ install-service.sh | 22 +++++++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index c1725f8..d681636 100644 --- a/.gitignore +++ b/.gitignore @@ -120,6 +120,8 @@ Thumbs.db # Project specific *.log logs/ +*.log.* +local/* config.ini config.min.ini *.db diff --git a/install-service.sh b/install-service.sh index 9561341..af4c897 100755 --- a/install-service.sh +++ b/install-service.sh @@ -475,18 +475,30 @@ else print_success "Created virtual environment at $INSTALL_DIR/venv" fi -# Upgrade pip first -print_info "Upgrading pip to latest version" -"$INSTALL_DIR/venv/bin/pip" install --quiet --upgrade pip >/dev/null 2>&1 || true +# Verify virtual environment looks healthy +VENV_PYTHON="$INSTALL_DIR/venv/bin/python" +if [ ! -x "$VENV_PYTHON" ]; then + print_error "Python virtual environment at $INSTALL_DIR/venv appears to be incomplete or corrupted" + print_error "Expected Python executable not found at: $VENV_PYTHON" + print_info "Try removing $INSTALL_DIR/venv and re-running this installer to recreate it:" + echo " sudo rm -rf $INSTALL_DIR/venv" + echo " sudo ./install-service.sh" + exit 1 +fi -# Install dependencies in venv +# Ensure pip is available and up to date inside the venv +print_info "Ensuring pip is available and up to date in the virtual environment" +$VENV_PYTHON -m ensurepip --upgrade >/dev/null 2>&1 || true +$VENV_PYTHON -m pip install --quiet --upgrade pip >/dev/null 2>&1 || true + +# Install dependencies in venv using python -m pip (more portable than calling pip directly) print_info "Installing Python dependencies from requirements.txt" print_info "This may take a few minutes depending on your internet connection..." if [ ! -f "$INSTALL_DIR/requirements.txt" ]; then print_error "requirements.txt not found in installation directory" exit 1 fi -"$INSTALL_DIR/venv/bin/pip" install --quiet -r "$INSTALL_DIR/requirements.txt" || { +$VENV_PYTHON -m pip install --quiet -r "$INSTALL_DIR/requirements.txt" || { print_error "Failed to install Python dependencies" print_info "You may need to check your internet connection or Python version" exit 1