-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
90 lines (85 loc) · 4.01 KB
/
pyproject.toml
File metadata and controls
90 lines (85 loc) · 4.01 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
85
86
87
88
89
90
[project]
name = "learn-python"
version = "1.0.0"
description = "Comprehensive Python curriculum: zero experience to full-stack mastery"
requires-python = ">=3.11"
license = "MIT"
[project.optional-dependencies]
dev = [
"pytest>=8.0",
"ruff>=0.4",
]
docs = [
"mkdocs-material>=9.5,<10",
"mkdocs>=1.6,<2",
"pymdown-extensions>=10.0,<11",
]
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B", "SIM"]
ignore = [
"E501", # line too long — handled by formatter
"E741", # ambiguous variable name — curriculum uses simple names for teaching
]
[tool.ruff.lint.per-file-ignores]
"projects/level-00-absolute-beginner/**" = ["F841", "E711", "B007"] # beginner exercises
"projects/**" = [
"I001", # unsorted imports — starter files keep imports in teaching order
"F401", # unused imports — pre-imported for learners to use
"F541", # f-string without placeholders — minor style, not worth fixing in 200+ files
"F632", # is-literal — teaching comparison patterns
"F841", # unused variable — exercises leave variables for learners to use
"F823", # undefined local — some files are scaffolds with TODOs
"E402", # module-level import not at top — setup code before imports is intentional
"E712", # true-false comparison — teaching comparison patterns
"E721", # type comparison — teaching type() before isinstance()
"E731", # lambda assignment — teaching lambda syntax
"B006", # mutable argument default — taught explicitly as a pitfall
"B007", # unused loop control variable — exercises use _ convention
"B008", # function call in default argument — teaching simplicity over strictness
"B011", # assert False — used in test files as quick failure markers
"B904", # raise without from — taught later in curriculum
"B905", # zip without strict — teaching basic zip first
"UP015", # redundant open modes — explicit "r" is clearer for beginners
"UP017", # datetime.timezone.utc — teaching older patterns before newer ones
"UP028", # yield in for loop — teaching explicit patterns
"UP032", # f-string — teaching .format() before f-strings
"UP035", # deprecated import — same reason as UP017
"UP041", # timeout-error-alias — asyncio.TimeoutError is clearer for learners
"UP045", # non-pep604-annotation — Optional[X] is clearer than X | None for learners
"SIM102", # collapsible-if — teaching explicit control flow
"SIM103", # needless-bool — teaching explicit returns
"SIM105", # suppressible-exception — teaching try/except before contextlib
"SIM108", # if-else-block-instead-of-if-exp — teaching explicit over ternary
"SIM114", # if-with-same-arms — teaching explicit branches
"SIM115", # open-file-with-context-handler — taught progressively
"SIM117", # multiple-with-statements — teaching explicit patterns
"SIM118", # in-dict-keys — teaching explicit dict access patterns
"SIM201", # negate-equal-op — teaching explicit comparisons
"SIM905", # split-static-string — teaching string methods
"SIM910", # dict-get-with-none-default — teaching explicit defaults
]
"practice/**" = [
"I001", "F401", "F541", "F841", "F823", "F632",
"E402", "E712", "E721", "E731",
"B006", "B007", "B008", "B011", "B904", "B905",
"UP015", "UP017", "UP028", "UP032", "UP035", "UP041", "UP045",
"SIM102", "SIM103", "SIM105", "SIM108", "SIM114", "SIM115", "SIM117", "SIM118", "SIM201", "SIM905", "SIM910",
]
"tools/**" = [
"I001", "F401", "F541", "F841",
"B007", "B008", "B905",
"SIM114", "SIM201",
]
"concepts/quizzes/**" = ["I001"]
[tool.pytest.ini_options]
testpaths = ["projects"]
python_files = ["test_*.py", "test_project.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"slow: tests that involve sleep, network calls, or deliberate delays",
"integration: end-to-end tests that exercise multiple components together with file I/O",
]