Skip to content

Latest commit

 

History

History
100 lines (65 loc) · 2.68 KB

File metadata and controls

100 lines (65 loc) · 2.68 KB

Contributing to grz-tools

This document provides guidelines for contributing to the grz-tools monorepo. Please follow below steps to set up your development environment and contribute effectively.

Please also refer to the individual package READMEs for any package-specific development setup instructions.

Development setup

  • This monorepo uses uv to manage Python virtual environments for development.
  • The grz-check package additionally requires the Rust toolchain to be installed.
  • The grz-db package additionally requires the PostgreSQL database server to be installed.

The simplest way to set up a development environment is to setup a conda environment with these dependencies: You can use either conda, mamba or micromamba for this, e.g.:

mamba env create -n grz-tools -f environment-dev.yaml
mamba activate grz-tools

Next, install the virtual environment using uv:

uv sync --all-packages --all-groups --all-extras

Running integration tests

To run integration tests for all packages in this monorepo, run the following from the repository root:

uv run tox

Some packages have their own unit tests. Run uv run tox while inside a specific package directory to run that package's unit tests.

Code formatting and linting

This project uses ruff for code formatting and linting.

To check code formatting and linting, run the following from the repository root:

uv run ruff check

Some errors can automatically be fixed by ruff:

uv run ruff check --fix

To auto-format the code, run:

uv run ruff format

Static type checking

This project uses mypy for static type checking. To run type checking, run the following from the repository root:

uv run mypy

Updating dependencies

Dependencies are specified in each package's pyproject.toml file. After changing dependencies, use uv sync to update the virtual environment for a specific package.

uv will only update the environment if the dependencies cannot be satisfied with the existing packages in the environment (see also uv.lock file). To update dependencies to their latest versions, use the --upgrade flag:

uv sync --all-packages --all-groups --all-extras --upgrade

Debugging Textual

Start the remote Textual debugging console on the machine you will use to debug the Textual app.


uv run textual console

Use the TEXTUAL=devtools environment variable to instruct Textual to connect to the remote debug console.

TEXTUAL=devtools uv run grzctl db --config-file config.db.yaml tui