Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
84 lines (75 loc) · 3.08 KB
/
Copy pathpyproject.toml
File metadata and controls
84 lines (75 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
[build-system]
requires = ["setuptools>=68", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "ducky"
version = "0.5.2"
description = "Local-first coding tutor with terminal UI, test runner, teacher-student connection, and anonymized reports."
readme = "README.md"
requires-python = ">=3.10"
license = { text = "MIT" }
authors = [{ name = "Ducky Project" }]
dependencies = [
"pytest>=7.0",
]
[project.optional-dependencies]
dev = [
"pytest>=7.0",
"pytest-timeout>=2.3",
"ruff>=0.4.0",
]
[project.scripts]
ducky = "ducky.cli:main"
ducky-gui = "ducky.gui:main"
ducky-teacher = "ducky.gui.teacher_gui:main"
[tool.setuptools]
package-dir = {"" = "src"}
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-data]
ducky = ["data/quizzes/*.json"]
[tool.pytest.ini_options]
testpaths = ["tests"]
# No single test may hang a CI job. The suite takes ~2.5 min in total, so 120s
# per test is roughly two orders of magnitude of headroom and still bounds a
# stuck test to two minutes instead of GitHub's 6-hour job limit.
#
# This is not theoretical. The macOS runner hung `pytest` indefinitely on the
# live-Tk test, which builds a real `tk.Tk()` root: on a runner with a window
# server available that construction *succeeds* rather than raising TclError, so
# the test does not take its skip path and then blocks. `thread` method so the
# timeout is enforced even when the test is stuck in C code, and the default
# signal method cannot interrupt Tk.
timeout = 120
timeout_method = "thread"
[tool.ruff]
line-length = 120
# The rule set is pinned explicitly. It used to be implicit, which meant a ruff
# upgrade could silently change what "lint passes" means -- and did: the
# unconfigured default grew from E4/E7/E9/F to several hundred rules, turning a
# clean tree into 405 findings nobody had agreed to. Keep this list deliberate.
# Add a rule here when you want it, not when a tool version decides for you.
lint.select = ["E", "F", "W", "I", "UP", "B", "SIM"]
lint.ignore = [
# Long lines are not a defect here; several teacher-facing message strings
# read far worse when wrapped.
"E501",
# Bare except is used deliberately at process boundaries where we must not
# let a teardown error mask the real failure.
"E722",
# Below are pure style, and the code they flag is overwhelmingly Tkinter
# widget construction where the rewrite is churn with real regression risk and
# no readability gain. Left enabled they would be fixed; leaving them ignored
# keeps the linter's remaining signal trustworthy. Revisit if the widget code
# is ever refactored wholesale.
"SIM101", # merge nested ifs
"SIM102", # collapse nested ifs
"SIM103", # explicit bool return
"SIM105", # contextlib.suppress instead of try/except/pass
"SIM108", # ternary instead of if/else assignment
"SIM117", # single `with` for nested context managers
"E741", # `l` as a variable name -- fine in short numeric loops
]
[tool.ruff.lint.per-file-ignores]
# Test modules import fixtures and helpers that look unused to the linter.
"tests/*" = ["F401", "F811"]