CodeVetter · Repo Unpack · Data flow
pypa/virtualenv
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.
- VirtualEnvConfigParser resolves environment defaults before INI defaults, then argparse applies CLI values; VirtualEnvOptions records source provenance used to arbitrate copy versus symlink settings.
- get_discover parses plugin selection and discovery-specific arguments; Discover.interpreter caches run() once, and Builtin passes specifications, preferred executables, app-data, and the supplied environment to external discovery.
- Describe maps target Python install paths to destination script_dir, purelib, and platlib; the same Creator object supplies these paths to seeding and activation.
- Creator.set_pyenv_cfg records interpreter home, implementation, versions, executable, command, and virtualenv version; PyEnvCfg.write normalizes only designated path keys and collapses line boundaries before UTF-8 output.
- get_wheel conditionally consults from_bundle before downloading; from_bundle combines embedded wheels, update history, and extra search directories, choosing a newer local candidate when compatible.
- FromAppData retrieves wheels in threads, keys images by target release, installer class, and wheel stem, builds missing images under a file lock, and copies or links image contents into purelib before generating console scripts.
- Activation converts destination, environment name, prompt, bin name, and Tcl/Tk values into quoted substitutions; templates are replaced in one pass and written to bin_dir, using UTF-8 BOM for PowerShell.
- Periodic updates persist started/completed timestamps and wheel histories in per-distribution JSON; subsequent bundle requests select eligible cached versions using one-hour CI and 28-day minor-release grace conditions.