5.2 A second group, for the checks

Read the tutorial. Build it yourself is the other way to read this part.

This walk goes through rahuldave/cheesecracker on GitHub. This part starts from the code at f77650600c11, partway through step-05. The code before this part

To look at this code on your machine, run these commands. The first one makes a clone, if this folder has none:

[ -d cheesecracker ] || git clone https://github.com/rahuldave/cheesecracker
cd cheesecracker
git fetch --quiet --tags --force origin
git switch --detach f77650600c11
just setup

The whole tutorial then adds the recipe just cov, and a change made in a hurry. ruff checks the code, and the server does not need it. So ruff starts a second group, lint.

5.2 ruff, the formatter and the linter, in the group lint

ruff is a formatter and a linter in one tool, written in Rust by Astral, the makers of uv. ruff format writes the code in the layout of black, the formatter of most Python projects. ruff check checks the rules of flake8 and of many other linters, and can fix some of them. It takes the place of both black and flake8, and runs much faster.

ruff checks the code, and the server does not need it to run. So ruff goes into a group of its own, lint.

This change came from running uv add --group lint ruff.

uv run ruff --version

uv prints the version of ruff, ruff 0.17.1 on the day of the class.

What changed

  • pyproject.toml: ruff, in the group lint. 3 lines added. It comes from uv add --group lint ruff. The file
    • look at "ruff>=0.17.1",
  • uv.lock: the exact version of ruff. 29 lines added. It comes from uv add --group lint ruff. The file

The diff of pyproject.toml
@@ -16,6 +16,9 @@ package = false
 default-groups = "all"
 
 [dependency-groups]
+lint = [
+    "ruff>=0.17.1",
+]
 test = [
     "httpx2>=2.13.1",
     "pytest>=9.1.1",

This change on GitHub

This part ends at the code at 9662828462ba, partway through step-05. The code after this part