Proteusiq / dotfiles

🦊 Waiting for the World to Change One Bytes
MIT License
1 stars 0 forks source link

Create .virtualenv folder with neovim and debug ... #19

Closed Proteusiq closed 2 months ago

Proteusiq commented 2 months ago

/.virtualenvs

Proteusiq commented 2 months ago

#!/bin/bash

create_virtualenvs() {
    # virtual environment directories and their respective packages
    declare -A envs
    envs["$HOME/.virtualenvs/neovim"]="pynvim"
    envs["$HOME/.virtualenvs/debugpy"]="pynvim debugpy"

    # create .virtualenvs directory if it doesn't exist
    mkdir -p "$HOME/.virtualenvs"

    # for each environment check existence and install 
    for env in "${!envs[@]}"; do
        # create it if not exist
        if [ ! -d "$env" ]; then
            python -m venv "$env"
        fi

        # upgrade pip and install the required packages
        "$env/bin/pip" install --upgrade pip
        "$env/bin/pip" install --upgrade ${envs[$env]}
    done

    echo "🔥 Virtual environments and 📦 packages installed."
}

# Call the function
create_virtualenvs
Proteusiq commented 2 months ago

Did not use uv because of pip. uv needs pip ensure but also it is a small installation