Vermin is a static analysis tool that concurrently detects the minimum Python versions required to run code. It is an actively maintained project with frequent updates, often adding support for the latest Python versions (e.g., 3.14, 3.13, 3.12) and expanding its rule set. It functions by parsing Python code into an abstract syntax tree (AST) and matching it against an extensive internal database of Python language features.
pip install verminVerified import paths — ran on the pinned version, not inferred.
Run Vermin from the command line on a specified Python file or directory to determine the minimum required Python versions.
Ensure you are running the 'vermin' command with a Python 3.x interpreter (e.g., `python3 -m vermin` or if `vermin` is in your PATH and points to Python 3).
To enable union type detection, use the `--feature union-types` command-line argument. Be aware of potential incorrect results due to heuristic-based detection.
Remove the `--lax` argument from your Vermin commands. Adjust your expectations or other configurations to accommodate the stricter default behavior.
If you suspect annotations are affecting results, try using `--eval-annotations`. However, consult the 'Caveats' section of the Vermin documentation, as this can sometimes yield incorrect results. `--no-eval-annotations` is on by default.
Ensure `pip`'s binary directory is in your system's PATH, or invoke it directly via `python3 -m vermin <path>`. Always run `vermin` from your system's command line (shell), not inside a Python interpreter.
Exit the Python REPL (e.g., by typing `exit()` or pressing Ctrl+D) and run the `vermin /path/to/file.py` command from your operating system's command line (bash, zsh, cmd, PowerShell, etc.).
This is not an error but a diagnostic. Either update your code to be compatible with the `--target` versions, increase your `--target` versions to match the minimums detected by Vermin, or use `--exclude` to ignore specific findings. When using `vermin --violations`, only the problematic lines are shown.
No dependency data recorded yet.