-
-
Notifications
You must be signed in to change notification settings - Fork 429
Open
Description
Description
pyenv-virtualenv keeps track of all virtual environments created using pyenv virtualenv, but does not track where those environments are used (i.e., which directories contain .python-version files referencing them).
This feature would improve environment management by logging usage context and allowing users to query where virtualenvs are active.
Problem
- No way to map virtualenvs to the directories that use them
- Makes it hard to clean up, audit, or understand which projects rely on which environments
- Users have to manually
grepfor.python-versionfiles to infer usage
Proposed Feature
Introduce optional usage tracking for virtualenvs:
- When a virtualenv is activated (via
pyenv activate, or a.python-versiontriggers it), log an entry with:- Timestamp
- Virtualenv name
- Path to the directory where it was used
Provide a new CLI command:
pyenv virtualenv usage— List all usage across virtualenvspyenv virtualenv usage <env-name>— Show where a specific env is used
Logging should be opt-in via an environment variable or config, such as:
export PYENV_VIRTUALENV_LOG_USAGE=1Metadata
Metadata
Assignees
Labels
No labels