Installation
codeanalyzer-python is published on PyPI and installs with any Python package manager.
Install
Section titled “Install”pip install codeanalyzer-pythonpipx install codeanalyzer-pythonuv tool install codeanalyzer-pythonThis installs the codeanalyzer command. Verify it:
codeanalyzer --helpPrerequisites
Section titled “Prerequisites”- Python 3.12 or higher.
Why system packages are needed
Section titled “Why system packages are needed”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.
sudo apt updatesudo apt install python3.12-venv python3-dev build-essentialsudo dnf group install "Development Tools"sudo dnf install python3-pip python3-venv python3-develOn older releases:
sudo yum groupinstall "Development Tools"sudo yum install python3-pip python3-venv python3-devel# Compiler toolchainxcode-select --install
# Homebrew Python (recommended)brew install python@3.12Using pyenv instead:
pyenv install 3.12.0 # or the latest 3.12.xpyenv global 3.12.0 # or `pyenv local 3.12.0` per projectOptional: CodeQL
Section titled “Optional: CodeQL”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.
From source (development)
Section titled “From source (development)”The project uses uv for development.
git clone https://github.com/codellm-devkit/codeanalyzer-pythoncd codeanalyzer-pythonuv sync --all-groups # installs runtime + test + dev dependenciesuv run codeanalyzer --input /path/to/python/projectRun the test suite with:
uv run pytest --pspec -s