Development

If you’d like to help out with the development of tt, we’d love to have you. Below are some helpful tips for working on this library. Feel free to reach out with any questions about getting involved in this project.

Managing with ttasks.py

tt ships with a script ttasks.py (tt + tasks = ttasks) in the project’s top-level directory to help manage common project tasks such as running tests, building the docs, and serving the docs via a live-reload server. You will see this script referenced below.

Dependencies

This project uses uv to manage its dependencies. To create a new virtual environment with uv, use:

uv venv
source .venv/bin/activate

Development dependencies can then be installed into this virtual environment with:

uv install

Testing

Testing is done with Python’s unittest and doctest modules. All tests can be run using the ttasks.py script:

python ttasks.py test

Specific unit tests can be run with:

python -m unittest -k test_constraints_eliminate_no_solutions

Note that while doc tests are used, their main purpose is to ensure the documentation examples are valid rather than extensively test functionality. The true behavior of the library and its public contract are enforced through the unit tests.

Local cross-Python version testing is achieved through uv:

uv run --python 3.11 ttasks.py test
uv run --python 3.12 ttasks.py test
uv run --python 3.13 ttasks.py test

Coding Style

tt aims to be strictly PEP8 compliant, enforcing this compliance via Ruff. This project also includes an editorconfig file to help with formatting issues.

Code linting and formatting checks can be performed with:

ruff check .
ruff format --check .

Code formatting can be applied with:

ruff format .

Documentation

To build the docs from source, run the following:

python ttasks.py build-docs

If you’re going to be working for a little while, it’s usually more convenient to boot up a live-reload server that will re-build the docs on any source file change. To run one on port 5000 of your machine, run:

python ttasks.py build-docs && python ttasks.py serve-docs

Releases

Releases are managed with uv:

uv build
uv publish