Development¶
Use this page when you want to change g itself. If you only want to install and run the command, start with Quickstart.
Bootstrap the project¶
Clone:
$ git clone https://github.com/vcs-python/g.git
$ cd g
Install packages:
$ uv sync --all-extras --dev
Tests¶
$ uv run py.test
The Makefile wrapper runs the same test command.
$ make test
Automatically run tests on file save¶
Run tests once, then keep watching with pytest-watcher:
$ make start
Watch through entr(1) if you have it installed:
$ make watch_test
Documentation¶
Default preview server: http://localhost:8034
sphinx-autobuild builds the docs, watches for file changes, and launches a server.
From the project root:
$ make start_docs
From inside docs/:
$ make start
Manual documentation¶
Enter the docs directory:
$ cd docs
Build the docs:
$ make html
Start the HTTP server:
$ make serve
Project-root helpers run the same docs tasks:
$ make build_docs
$ make serve_docs
Rebuild docs on file change with entr(1):
$ make watch_docs
Rebuild docs and run the server through one terminal when your GNU Make has
-J support:
$ make dev_docs
Formatting / Linting¶
Linting and formatting¶
The project uses ruff to handle formatting, sorting imports and linting.
uv:
$ uv run ruff check .
If you set up manually:
$ ruff check .
$ make ruff
$ make watch_ruff
requires entr(1).
uv:
$ uv run ruff check . --fix
If you set up manually:
$ ruff check . --fix
Code formatting¶
Use ruff format for formatting.
uv:
$ uv run ruff format .
If you set up manually:
$ ruff format .
$ make ruff_format
Type checking¶
Use mypy for static type checking.
uv:
$ uv run mypy .
If you set up manually:
$ mypy .
$ make mypy
$ make watch_mypy
requires entr(1).
Releasing¶
uv handles virtualenv creation, package requirements, versioning,
building, and publishing. There is no setup.py or requirements file.
See Releasing before preparing a release.