CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

pypa/virtualenv

Scanned commit 571bc2041d dated 2026-10-02 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/pypa/virtualenv ↗ · 278 files · 2.1 MB

virtualenv A tool for creating isolated virtual python environments.

Deep analysis by cli:codex via the codex CLI on 2026-10-02 (416s) — every claim below links to its cited source files. Source inspection; upstream code and tests were not executed.

Overview

virtualenv creates isolated Python environments for developers and tools that need a reusable environment-building API. At commit 571bc2041dae5ecbd250d82ec7ef482cfd3c3b69, it combines interpreter discovery, platform-specific creation, cached installation of seed packages, and shell activation through four plugin groups. Its distinctive boundaries are the target environment, a persistent per-user cache, external python-discovery, and optional pip/PyPI subprocess and network operations.

System map

The runtime is a Python CLI and library organized around a creation session. Discovery, creation, seeding, and activation are selected through installed package metadata. Persistent state lives in app-data folders, while generated environment files live under the chosen destination with a guarded adjacent redirect. Packaging supports wheels, source distributions, and a standalone zipapp.

Feature catalog

The primary command builds an environment at a positional destination, with selectable interpreter and creation strategy. Users control seed packages, activation scripts, configuration sources, and cache maintenance. The library API returns a session for inspecting environment properties. Additional outputs include environment metadata, cache/VCS markers, and a provisional project discovery redirect.

Data flow

CLI arguments, environment variables, and INI values become a provenance-aware options namespace. Discovery yields PythonInfo, and the creator owns destination layout and environment metadata shared by seeders and activators. Wheels move through verification, cache selection, installation images, and generated console scripts. Update processes persist version history for later runs.

Behavior traces

Source walks followed startup and selection, environment creation and cached seeding, activation, and persistent wheel updates. Startup performs repeated partial parsing because selected implementations contribute additional arguments. Creation has separate builtin and stdlib venv branches. Activation generates scripts that users subsequently source; updates can continue in a background process.

Testing signals

Tests and CI were inspected, not executed; their existence establishes intended checks, not passing results. The inspected suite uses pytest, coverage, mocks, parallel workers, Hypothesis properties, and separate tooling checks. Coverage includes CLI selection, discovery, cached seeding, redirects, digest handling, and extraction safety. This inventory is bounded, and inspected mocked network tests do not establish live service behavior.

Risk map

These are source observations and explicitly labeled hypotheses, not confirmed vulnerabilities. The important boundaries involve executing trusted interpreters/plugins, downloading executable packages, generating shell/configuration text, and deleting or overwriting filesystem state. Controls include strict download arguments, digest checks, extraction containment, and quoted substitutions. Cache reuse and subprocess environment handling deserve focused review because their behavior spans multiple invocations and processes.

Extension points

Installed Python entry points form the principal extension mechanism. Each stage has a selection adapter and an implementation interface, with interpreter capabilities constraining applicable choices. Creation can extend filesystem references and layouts, while seeding can replace installation strategy. Activators pair shell-specific classes with templates, and storage/build hooks provide additional internal seams.

Contributor handoff

Start with orchestration and the selected implementation rather than assuming the inventory reflects current ownership. Tests and CI were inspected, not executed, and the brief covers a bounded set of source paths. Preserve option provenance, cache/version boundaries, shell quoting, and platform-specific layout behavior when making changes. Execution, installation, and release commands require a later task that authorizes them.

Languages

LanguageFilesShare of source
Python18295%
YAML21docs/config
JSON9docs/config
Markdown9docs/config
TOML42%
C21%
JavaScript21%
CSS1docs/config

Start reading here

Probable source entrypoint: pyproject.toml — inferred from the directory tree and manifest, not the upstream docs.

Source roots

src/ (104 files)

Source layout — src/

PathFiles
src/virtualenv/104

Repository structure

Top-level pathFiles
src/104
tests/77
.github/36
docs/27
tasks/20

Docs found: README.md

Package

pyproject.toml — virtualenv vvcs, 0 declared dependencies.

CI & config entrypoints

Structural health signals

Average score 8/10 across 96 analyzed source files; 6 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history