Development setup
Git-Mastery is standardizing on a uv-first local development workflow.
Use the guidance on this page as the default when setting up repositories locally.
Some repositories are still in transition, and may be using
pipandvenvfor local development.
Prerequisites
- Git
- Python 3.13+
uv(refer to installation guide)- GitHub CLI (
gh) installed and authenticated when working on flows that interact with GitHub - Git-Mastery app installed and configured (refer to the setup guide)
Repository setup (uv)
- Fork the repository you want to work on.
-
Clone your fork.
git clone https://github.com/<username>/<repository> cd <repository> -
Run the following command to set up virtual environment and install dependencies:
The
--all-groupsflag ensures all dependencies are installed, including those for development and testing. Development and testing dependencies are needed for running pre-commit hooks and tests locally.uv sync --all-groups -
Set up pre-commit hooks using LeftHook
Recommended to install for formatting and linting support.
uv run lefthook install
Repository setup (pip)
Deprecated
As we are transitioning to uv, this setup is still relevant for some repositories.
- Fork the repository you want to work on.
-
Clone your fork.
git clone https://github.com/<username>/<repository> cd <repository> -
Run the following command to set up virtual environment and install dependencies:
pip install -r requirements.txt python -m venv .venv source .venv/bin/activate # macOS/Linux source .venv/Scripts/activate # Windows -
Set up pre-commit hooks using LeftHook
Recommended to install for formatting and linting support.
lefthook install
Troubleshooting
Pre-commit hooks not running as expected after migration to uv
-
Delete existing hooks in
.git/hooks/to remove any oldpip-based hooks.rm -rf .git/hooks/pre-commit -
Re-run
uv run lefthook installto set up the new hooks.