Skip to content

Work with base environments #12

@sglbl

Description

@sglbl

Since latest Linux version don't support installing apps with pip (except --break-system-packages), I have a base environment on uv (similar to conda).

My .bashrc:

# ---------------------------
# Python env auto-activation (uv)
# ---------------------------

# Clean up inherited but inactive python environments (e.g. VSCode parent process env leakage)
if [ -n "$VIRTUAL_ENV" ] && ! declare -F deactivate >/dev/null; then
    PATH=$(echo ":$PATH:" | sed "s|:$VIRTUAL_ENV/bin:|:|g" | sed "s|^:||; s|:$||")
    export PATH
    unset VIRTUAL_ENV
fi

if [ -x "$PWD/.venv/bin/python" ]; then
    deactivate 2>/dev/null || true
    source "$PWD/.venv/bin/activate"
else
    if [ -z "$VIRTUAL_ENV" ]; then
        source ~/.local/share/uv/environments/base/bin/activate
    fi
fi

With this, extension doesn't work well and even though it says .venv is selected, it's not.

Screencast.from.2026-03-02.12-21-44.webm

I care about a base environment for tests so is there a way of support?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions