After checking out the repository, you can install kalamine and its development dependencies like this:
python3 -m pip install --user .[dev]Which is the equivalent of:
python3 -m pip install --user -e .
python3 -m pip install --user build ruff pytest mypy types-PyYAML pre-commitThere’s also a Makefile recipe for that:
make devWe rely on ruff for that, with the isort rule enabled:
ruff format kalamine
ruff check --fix kalamineAlternative:
make formatWe rely on ruff and mypy for that, with their default configurations:
ruff format --check kalamine
ruff check kalamine
mypy kalamineAlternative:
make lintMany linting errors can be fixed automatically:
ruff check --fix kalamineWe rely on pytest for that, but the sample layouts must be built by kalamine first:
python3 -m kalamine.cli make layouts/*.toml
pytestAlternative:
make testYou may ensure manually that your commit will pass the Github CI (continuous integration) with:
makeBut setting up a git pre-commit hook is strongly recommended. Just create an executable .git/hooks/pre-commit file containing:
#!/bin/sh
makeThis is asking git to run the above command before any commit is created, and to abort the commit if it fails.