How pypa/pipenv works
Pipenv manages a project’s Python environment and dependencies: users invoke CLI commands that update the Pipfile, resolve and lock dependency versions, install packages into a virtualenv, and can then inspect or run the environment. The graph also captures documented project discovery, shell/.env support, dependency checks, and the bundled pip installation layer. Edges use README statements or SOURCE INDEX references; several internal implementation details are unsampled, so uncertain links are omitted.
Main entry points: command.py CLI dispatcher · project.py Project manager · install.py Install routine · lock.py Lock routine
Components 20
Command interface
- CLI dispatcher
pipenv/cli/command.py
Project state
- Project manager
pipenv/project.py - Pipfile and lock
pipenv/utils/pipfile.py - Environment settings
pipenv/environments.py
Dependency workflow
- Install routine
pipenv/routines/install.py - Lock routine
pipenv/routines/lock.py - Dependency checks
pipenv/routines/check.py - Dependency graph
pipenv/routines/graph.py - Security audit
pipenv/routines/audit.py - Dependency conversion
pipenv/utils/dependencies.py - Dependency resolver
pipenv/resolver/core.py - Resolver entry
pipenv/resolver/main.py - Bundled pip install
pipenv/patched/pip/_internal/commands/install.py
Environment runtime
- Virtualenv management
pipenv/utils/virtualenv.py - Python environment
pipenv/environment.py - Shell integration
pipenv/routines/shell.py - Shell utilities
pipenv/utils/shell.py
Other components
- Developer
- Package index
- Python runtime
Connections 28
- Developer → CLI dispatcher: runs commands
- CLI dispatcher → Install routine: dispatches
pipenv/cli/command.py - CLI dispatcher → Lock routine: dispatches
pipenv/cli/command.py - CLI dispatcher → Dependency checks: dispatches
pipenv/cli/command.py - CLI dispatcher → Dependency graph: dispatches
pipenv/cli/command.py - CLI dispatcher → Security audit: dispatches
pipenv/cli/command.py - Install routine → Lock routine: invokes
pipenv/routines/install.py - Install routine → Pipfile and lock: updates declarations
pipenv/routines/install.py - Lock routine → Pipfile and lock: writes lock data
- Lock routine → Resolver entry: resolves dependencies
- Resolver entry → Dependency resolver: uses resolver
pipenv/resolver/main.py - Dependency resolver → Dependency conversion: uses dependency data
pipenv/utils/resolver.py - Install routine → Bundled pip install: installs packages
- Bundled pip install → Package index: fetches packages
- Project manager → Pipfile and lock: loads project files
pipenv/project.py - Project manager → Dependency conversion: uses dependency helpers
pipenv/project.py - Project manager → Virtualenv management: discovers environment
pipenv/project.py - Virtualenv management → Python runtime: selects interpreter
- Virtualenv management → Python environment: provides environment
pipenv/environment.py - CLI dispatcher → Shell integration: dispatches
pipenv/cli/command.py - Shell integration → Shell utilities: uses shell helpers
- Environment settings → Project manager: configures settings
pipenv/project.py - Dependency checks → Pipfile and lock: checks declarations
- Dependency graph → Python environment: inspects installed packages
- Security audit → Package index: checks vulnerabilities
- Project manager → Environment settings: reads environment options
pipenv/project.py - Developer → Project manager: selects project
- Python environment → Shell utilities: loads .env support
pipenv/environment.py