Development Environment Setup

This is a detailed guide on how to set up Python, Git, and a development environment for our projects. Following these instructions will ensure that every contributor has the same tools installed at the same versions in the same way, which makes it easier for everyone to help each other.

If you're already familiar with contributing to Python projects, you can refer to the Quick Reference instead.

GitHub and Git

Install Python

Install the latest version of Python.

Install Python dependencies

Pallets projects use two different ways of managing dependencies: pip and uv. Projects are being upgraded to use uv, but many projects still use pip. If the project has requirements folder, that means it is using the older pip flow. Check for that folder and follow the appropriate steps below.

Projects with a requirements directory

Projects without a requirements directory

Install uv.

Install dev dependencies:

$ uv sync

Activate the virtualenv (Mac and Linux):

$ . .venv/bin/activate

Activate the virtualenv (Windows):

> .\.venv\Scripts\activate

Any time you open a new terminal, you need to activate the virtualenv again. If you've pulled from upstream recently, you can re-run the uv sync command to get the current dev dependencies.

Install pre-commit hooks

Pre-commit hooks automatically run linters and formatters before each git commit, catching style issues early so they don't appear as CI failures later.

$ pre-commit install --install-hooks

Debugger

Many IDEs, including [PyCharm] and [VS Code], include a debugger UI. There are also standalone debuggers such as pudb, pdbp, ipdb, and bpdb.