Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

インストール

The bindings are distributed as a prebuilt binary wheel. Install with pip, or with your lockfile manager of choice (uv, poetry, pdm):

pip install big-code-analysis

Python >=3.12 is required. The compiled extension uses CPython’s stable abi3 surface (abi3-py312), so one wheel covers 3.12, 3.13, 3.14, and every future minor release without a per-version wheel build.

Wheel マトリクス

CI は現在、以下のターゲット向けの wheel を公開しています。お使いのプラットフォームが記載されていない場合は、ソースからビルドしてください。

プラットフォームアーキテクチャ
Linux(manylinux_2_28)x86_64, aarch64

The wheel matrix is defined in .github/workflows/python-wheels.yml. manylinux_2_28 requires glibc >= 2.28 (RHEL 8 / Debian 10 / Ubuntu 18.10 and newer); older distributions (RHEL 7 / CentOS 7, glibc 2.17) need to build from source. macOS and Windows wheels are not yet shipped, so pip install on those platforms falls back to a source build today.

インストールの確認

python -c "import big_code_analysis as bca; print(bca.__version__)"

The printed version equals [workspace.package].version in the Rust workspace’s Cargo.toml. The bindings and Rust library share a version.

ソースからのビルド

お使いのプラットフォームに合う wheel がない場合や、未リリースの Rust コミットに対してバインドしたい場合は、maturin でビルドします。

git clone https://github.com/dekobon/big-code-analysis.git
cd big-code-analysis/big-code-analysis-py
python -m venv .venv && source .venv/bin/activate
pip install --upgrade pip
pip install "maturin>=1.7,<2.0"
maturin develop --release   # big_code_analysis を編集可能な形でインストール
python -c "import big_code_analysis as bca; print(bca.__version__)"

maturin develop builds the Rust extension in place and installs it into the active venv so import big_code_analysis resolves locally; no separate pip install -e . step is required. The --release flag turns on the optimiser; omit it during development for faster rebuilds.

You also need:

  • 安定版の Rust ツールチェーン(MSRV: 1.94)。rustup からインストールしてください。
  • A C compiler (used by the tree-sitter grammar crates).
  • CPython の開発用ヘッダー(Debian / Ubuntu では python3-dev)。

次のステップ

Walk through the quick-start to compute your first metric, or skip ahead to batch processing if you are wiring this into a pipeline over many files.