The following tools must be available on your system to set up a development environment:
Ensure one of the supported Pythons (see README) is installed and used by the python executable:
python3 --versionThen create and activate a virtual environment. If you don't have any other way of managing virtual environments this can be done by running:
make install
source .venv/bin/activateEnsure that a supported version of PostgreSQL (see README) is installed and running on your local machine.
To install all the development dependencies in your virtual environment, run:
make installTo start the tests with tox, run:
make testAlternatively, if you want to run the tests directly in your virtual environment, you many run the tests with:
PYTHONPATH=src python3 -m pytestRun all static analysis tools with:
make lintPackage dependencies are declared in pyproject.toml.
- package dependencies in the
dependenciesarray in the[project]section. - development dependencies in the
devarray in the[project.optional-dependencies]section.
For local development, the dependencies declared in pyproject.toml are pinned to specific
versions using the uv.lock lock file.
You should not manually edit the uv.lock lock file.
To install a new Python dependency add it to the appropriate section in pyproject.toml and then
run:
make installThis will:
- Build a new version of the
uv.locklock file containing the newly added package. - Sync your installed packages with those pinned in
uv.lock.
This will not change the pinned versions of any packages already in the lock file unless needed by the new packages, even if there are updated versions of those packages available.
Remember to commit your changed uv.lock files alongside the changed
pyproject.toml.
Removing Python dependencies works exactly the same way: edit pyproject.toml and then run
make install.
To update the pinned versions of all packages run:
make updateThis will update the pinned versions of every package in the uv.lock lock
file to the latest version which is compatible with the constraints in pyproject.toml.
You can then run:
make installto sync your installed packages with the updated versions pinned in uv.lock.
Upgrade a single development dependency with:
uv lock -P $PACKAGE==$VERSION --resolver=backtrackingYou can then run:
make installto sync your installed packages with the updated versions pinned in uv.lock.