Skip to content

Latest commit

 

History

History
74 lines (45 loc) · 2.51 KB

DEVELOPMENT.md

File metadata and controls

74 lines (45 loc) · 2.51 KB

Development

Dotbot uses the Hatch project manager (installation instructions).

Hatch automatically manages dependencies and runs testing, type checking, and other operations in isolated environments.

Testing

You can run the tests on your local machine with:

hatch test

The test command supports options such as -c for measuring test coverage, -a for testing with a matrix of Python versions, and appending an argument like tests/test_shell.py::test_shell_can_override_defaults for running a single test.

Isolation

Dotbot executes shell commands and interacts with the filesystem, and the tests exercise this functionality. The tests try to insulate themselves from the machine, but if you prefer to run tests in an isolated container using Docker, you can do so with the following:

docker run -it --rm -v "${PWD}:/dotbot" -w /dotbot python:3.13-bookworm /bin/bash

After spawning the container, install Hatch with pip install hatch, and then run the tests as described above.

Type checking

You can run the mypy static type checker with:

hatch run types:check

Formatting and linting

You can run the Ruff formatter and linter with:

hatch fmt

This will automatically make safe fixes to your code. If you want to only check your files without making modifications, run hatch fmt --check.

Packaging

You can use hatch build to create build artifacts, a source distribution ("sdist") and a built distribution ("wheel").

You can use hatch publish to publish build artifacts to PyPI.

Continuous integration

Testing, type checking, and formatting/linting is checked in CI.