Files
018-hirst-painting/pyproject.toml
Tirsvad b7119ef907 Add the colour palette: white-shade filter and palette extraction
MIL-001 tasks 1 to 6.

- Pin the toolchain and tool configuration in pyproject.toml: Python 3.13,
  colorgram.py 1.2.0, and ruff, mypy (strict) and pytest as dev tools.
- Add is_white_shade and remove_white_shades (threshold 240) with tests that
  pin the boundary at 239 and 240.
- Add extract_palette, which reads the reference image with colorgram and drops
  white shades, with tests on synthetic images and on the reference image.
- Add the reference image assets/20260524_132700.jpg and a note on it.
- Record the code review against QC-PY-001 as RC-005 (verdict Go).

Closes #1
Closes #2
Closes #3
Closes #4
Closes #5
Closes #6

Task: MIL-001#1
Task: MIL-001#2
Task: MIL-001#3
Task: MIL-001#4
Task: MIL-001#5
Task: MIL-001#6
2026-10-07 23:49:38 +08:00

54 lines
1.5 KiB
TOML

[project]
name = "hirst-painting"
version = "0.1.0"
description = "Hirst-style spot painting drawn with turtle (Day 18 of 100 Days of Code)."
readme = "README.md"
requires-python = ">=3.13"
# Toolchain verified on 2026-10-07 (MIL-001 task 1): Python 3.13.14, Tk 8.6 and
# colorgram.py 1.2.0 with Pillow 12.3.0. Pillow is pulled in by colorgram.py.
dependencies = [
"colorgram.py==1.2.0",
]
[dependency-groups]
dev = [
"mypy==2.4.0",
"pillow==12.3.0",
"pytest==9.1.1",
"ruff==0.16.10",
]
[tool.ruff]
line-length = 88
target-version = "py313"
src = ["src", "tests"]
# The framework is a mounted submodule and is never edited from this project.
extend-exclude = ["framework", ".agents", ".claude"]
[tool.ruff.lint]
# pycodestyle, pyflakes, isort, pep8-naming, pydocstyle, pyupgrade, bugbear,
# flake8-annotations: the rules behind QC-PY-001 criteria 1, 3, 4, 6 and 8.
select = ["E", "W", "F", "I", "N", "D", "UP", "B", "ANN"]
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.per-file-ignores]
# Test names state the behaviour, so a docstring would only repeat them.
"tests/*" = ["D103"]
[tool.mypy]
strict = true
mypy_path = "src"
files = ["src", "tests"]
[[tool.mypy.overrides]]
# colorgram.py ships no type information; its values are converted to Colour at
# the boundary in extract_palette, so nothing untyped spreads further.
module = "colorgram"
ignore_missing_imports = true
[tool.pytest.ini_options]
pythonpath = ["src"]
testpaths = ["tests"]