Detection Logic
envoic classifies directories by combining definitive and strong filesystem signals.
Signal hierarchy
Definitive signals
pyvenv.cfgpresent
This is the strongest indicator for venv/virtualenv style environments.
Strong signals
- Python executable (
bin/pythonorScripts/python.exe) - site-packages directory layout
- activate scripts
conda-metadirectory
Multiple strong signals increase confidence.
Classification rules
At a high level:
- If
conda-metaexists → classify asconda. - Else if definitive/strong venv signals match → classify as
venv. - Else if directory name is
.env→ classify asdotenv_dir. - Else →
unknown.
Normal scan output excludes unknown.
Signals field
Each detected environment carries a signals list that records matched checks, such as:
pyvenv.cfgconda-metapython-binarysite-packagespython+site-packagesactivate-script
This makes detection decisions inspectable and scriptable.
Artifact detection
The scanner also detects Python ecosystem artifacts during the same filesystem walk:
- Bytecode:
__pycache__/,*.pyc,*.pyo - Tool caches:
.mypy_cache/,.pytest_cache/,.ruff_cache/ - Test envs:
.tox/,.nox/ - Build artifacts:
dist/,build/,.eggs/,*.egg-info/ - Coverage/notebook:
.ipynb_checkpoints/,htmlcov/,.coverage
Safety tiers are reported per pattern:
always_safe: regenerated automaticallyusually_safe: usually fine to remove, may require rebuildcareful: may break editable installs or take time to recreate
build/ and dist/ are only treated as Python artifacts when their parent directory looks like a Python project (pyproject.toml, setup.py, or setup.cfg present).