feat(setup): add pyenv support for Python version management

This commit is contained in:
Gigi
2025-04-07 13:34:42 +01:00
parent d5ef34fe88
commit 01642ba771

View File

@@ -1,9 +1,29 @@
#!/bin/bash
# Check if pyenv is installed
if ! command -v pyenv &> /dev/null; then
echo "pyenv is not installed. Please install pyenv first."
echo "You can install it using: brew install pyenv (or similar)"
exit 1
fi
# Read Python version from .python-version file
PYTHON_VERSION=$(cat .python-version)
# Install Python version if not already installed
if ! pyenv versions | grep -q "$PYTHON_VERSION"; then
echo "Installing Python $PYTHON_VERSION..."
pyenv install "$PYTHON_VERSION"
fi
# Set local Python version
echo "Setting Python version to $PYTHON_VERSION..."
pyenv local "$PYTHON_VERSION"
# Check if virtual environment exists
if [ ! -d "vibenv" ]; then
echo "Creating virtual environment..."
python3 -m venv vibenv
python -m venv vibenv
fi
# Activate virtual environment
@@ -12,6 +32,6 @@ echo "Activating virtual environment..."
# Install requirements
echo "Installing requirements..."
pip3 install -r requirements.txt
pip install -r requirements.txt
echo "Setup complete! Virtual environment is activated and requirements are installed."