Development setup¶
Requirements¶
| Requirement | Version | Notes |
|---|---|---|
| Python | 3.11 or newer | pyproject.toml sets requires-python = ">=3.11"; CI tests 3.11–3.14 |
| Git | any recent version | Needed to clone the repo and to create fixtures |
| C toolchain | only if no pygit2 wheel exists for your platform |
libgit2 headers required in that case |
Clone and bootstrap¶
make setup runs scripts/bootstrap.sh, which:
- finds the first of
python3.11,python3,pythonthat reports version ≥ 3.11, - creates
.venv(recreating it if an existing one is older than 3.11), - upgrades
pip,setuptools,wheel, - installs the project in editable mode with dev extras:
pip install -e ".[dev]".
Then activate it:
Manual setup¶
If you prefer not to use the Makefile:
Using uv¶
uv is a fast alternative and is convenient when your system Python is older than 3.11 —
it downloads an interpreter for you:
Do not install with a Python older than 3.11
pip install -e . under Python 3.10 will try to resolve incompatible dependency versions
and can appear to hang for a long time before failing. Check with python -V first.
What gets installed¶
| Extra | Packages |
|---|---|
| runtime | pygit2>=1.16, typer>=0.15, rich>=13.9, pydantic>=2.10 |
dev |
build>=1.2, pytest>=8.3, pytest-cov>=6.0, ruff>=0.9, twine>=6.1 |
Documentation tooling is not part of the dev extra — install it separately when working
on this site:
See Working on the docs.
Verify the installation¶
python -m pytest -q # 6 tests should pass
python -m ruff check src tests # no findings
gitintel version # prints the installed version
gitintel analyze . # analyze the GitIntel repo itself
Both console scripts (gitintel and gitit) and python -m gitintel point at the same Typer
application.
Editable install behaviour¶
The project uses a src/ layout with setuptools. After pip install -e ., edits to files under
src/gitintel/ take effect immediately — no reinstall needed. Reinstall only when you change
pyproject.toml (dependencies, entry points, metadata).
Editor configuration¶
- Interpreter — point your editor at
.venv/bin/python. - Formatting/linting — Ruff with the settings from
pyproject.toml(line-length = 88,target-version = "py311", rulesFandI). Enable "organize imports on save" with Ruff so theIrules stay satisfied. - Tests — pytest, rootdir the repository root, test path
tests.