Skip to content

Installation

codeanalyzer-python is published on PyPI and installs with any Python package manager.

Terminal window
pip install codeanalyzer-python

This installs the codeanalyzer command. Verify it:

Terminal window
codeanalyzer --help
  • Python 3.12 or higher.

To analyze a project the way it actually runs, codeanalyzer builds an isolated virtual environment for it (under .codeanalyzer/) using Python’s built-in venv module, installs the project’s dependencies into it, and resolves symbols against that environment. That means the host needs venv support and a compiler toolchain for any dependencies with native extensions.

Terminal window
sudo apt update
sudo apt install python3.12-venv python3-dev build-essential

CodeQL-based resolution is opt-in via --codeql. You do not need to install CodeQL yourself — on first use codeanalyzer downloads the CLI into the project cache (<cache-dir>/codeql/) and reuses it. If a codeql binary is already on your PATH, the project-local copy still takes precedence for deterministic behavior. See CodeQL analysis.

The project uses uv for development.

Terminal window
git clone https://github.com/codellm-devkit/codeanalyzer-python
cd codeanalyzer-python
uv sync --all-groups # installs runtime + test + dev dependencies
uv run codeanalyzer --input /path/to/python/project

Run the test suite with:

Terminal window
uv run pytest --pspec -s