Skip to content

install_python_venv() may upgrade system Python instead of venv #2692

@coderabbitai

Description

@coderabbitai

Context

In base-images/utils/aipcc.sh, the install_python_venv() function creates a virtual environment but then uses ${PYTHON} to upgrade pip/setuptools/wheel:

function install_python_venv() {
    # install venv with bundled pip (no --upgrade-deps)
    "${PYTHON}" -m venv "${VIRTUAL_ENV}"

    "${PYTHON}" -m pip install --force-reinstall --upgrade \
            --index-url https://pypi.org/simple/ \
            pip setuptools wheel
}

Issue

Using ${PYTHON} for the pip upgrade may upgrade the system/base Python interpreter instead of the venv's Python, unless PYTHON already points to the venv interpreter.

Note

Per @jiridanek: "the current implementation is what aipcc does" - this follows the existing AIPCC pattern.

Backlinks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

📋 Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions