-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathpyproject.toml
More file actions
224 lines (209 loc) · 10.2 KB
/
Copy pathpyproject.toml
File metadata and controls
224 lines (209 loc) · 10.2 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
[project]
name = "gatorgrade"
version = "0.11.2"
description = "GatorGrade executes GatorGrader checks!"
authors = [
{ name = "Michael Abraham" },
{ name = "Jacob Allebach" },
{ name = "Liam Black" },
{ name = "Katherine Burgess" },
{ name = "Pallas-Athena Cain" },
{ name = "Yanqiao Chen" },
{ name = "Ochirsaikhan Davaajambal" },
{ name = "Tuguldurnemekh Gantulga" },
{ name = "Anthony Grant-Cook" },
{ name = "Dylan Holland" },
{ name = "Gregory M. Kapfhammer" },
{ name = "Peyton Kelly" },
{ name = "Luke Lacaria" },
{ name = "Douglas Luman" },
{ name = "Lauren Nevill" },
{ name = "Rebekah Rudd" },
{ name = "Titus Smith" },
{ name = "Molly Suppo" },
{ name = "Jack Turner" },
{ name = "Daniel Ullrich" },
{ name = "Garrison Vanzin" },
{ name = "Rian Watson" },
]
requires-python = ">=3.10,<4.0"
readme = "README.md"
dependencies = [
"PyYAML>=6.0,<7",
"typer>=0.20.0,<0.21",
"rich>=13.8.1,<14",
"click>=8.3.0,<9",
"platformdirs>=4.10.0",
"gatorgrader>=1.1.3",
]
[project.optional-dependencies]
auto-hint = [
"openai>=2.44.0",
"torch>=2.12.1",
"transformers>=5.13.0",
]
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true
[tool.uv.sources]
torch = [
{ index = "pytorch-cpu" },
]
torchvision = [
{ index = "pytorch-cpu" },
]
[project.scripts]
gatorgrade = "gatorgrade.main:app"
[dependency-groups]
dev = [
"taskipy>=1.10.1,<2",
"pytest>=7.1.1,<10",
"pytest-cov>=6.0.0,<7",
"pydocstyle>=6.1.1,<7",
"toml>=0.10.2,<0.11",
"pytest-sugar>=1.0.0,<2",
"pytest-randomly>=3.12.0,<4",
"pytest-clarity>=1.0.1,<2",
"symbex>=1.4,<2",
"mypy>=1.11.2,<2",
"types-pyyaml>=6.0.12.20240917,<7",
"ty>=0.0.8",
"cosmic-ray>=8.4.3",
"ruff>=0.15.15",
"zuban>=0.7.2",
"pyrefly>=1.0.0",
"tree-sitter>=0.25.2",
"tree-sitter-python>=0.25.0",
"rumdl>=0.2.4",
"types-toml>=0.10.8.20260518",
"hypothesis>=6.155.2",
"tree-sitter-analyzer[popular]>=0.4.0",
"pytest-xdist>=3.8.0",
]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.taskipy.variables]
project = "gatorgrade"
scripts = "scripts"
tests = "tests"
coveragefailunder = "95"
directtestedfailunder = "75"
ruff-check-command = { var = "ruff check {project} {tests} {scripts}", recursive = true }
coverage-test-command = { var = "pytest -s --cov=gatorgrade --cov-branch --cov-fail-under=98 --cov-report=term-missing tests/", recursive = true }
coverage-test-command-silent = "pytest -x --show-capture=no --cov-report term-missing --cov-report json --cov --cov-branch"
developer-test-command = "pytest -x -s"
developer-test-silent-command = "pytest -x --show-capture=no"
ruff-fixformat-command = { var = "ruff format {project} {tests} {scripts}", recursive = true }
ruff-format-command = { var = "ruff format --check {project} {tests} {scripts}", recursive = true }
symbex-typed-command = {var = "symbex -s --untyped -d {project} -d {tests} -d {scripts} --check", recursive = true}
symbex-documented-command = {var = "symbex -s --undocumented -d {project} -d {tests} -d {scripts} --check", recursive = true}
mypy-command = {var = "mypy {project} {scripts}", recursive = true}
ty-command = {var = "ty check {project} {tests} {scripts}", recursive = true}
pyrefly-command = {var = "pyrefly check {project} {tests} {scripts}", recursive = true}
rumdl-command = {var = "rumdl check", recursive = true}
rumdl-command-fix = {var = "rumdl fmt", recursive = true}
zuban-command = {var = "zuban check {project} {tests} {scripts}", recursive = true}
cosmic-ray-init-command = "cosmic-ray init cosmic-ray.toml cosmic-ray.sqlite"
cosmic-ray-exec-command = "cosmic-ray exec cosmic-ray.toml cosmic-ray.sqlite"
cosmic-ray-report-command = "cosmic-ray dump cosmic-ray.sqlite"
cosmic-ray-baseline-command = "cosmic-ray baseline cosmic-ray.toml"
[tool.taskipy.tasks]
all = "task check && task test && task test-coverage-check"
check = "task lint && task typecheck"
lint = "task ruff-format && task ruff-check && task comments-check && task vsc && task rumdl-check"
typecheck = "task mypy && task ty && task pyrefly && task zuban && task symbex"
ruff-check = { cmd = "{ruff-check-command}", help = "Run the ruff linting checks", use_vars = true }
ruff-format = { cmd = "{ruff-format-command}", help = "Run the ruff formatter on source code", use_vars = true }
ruff-format-fix = { cmd = "{ruff-fixformat-command}", help = "Run the ruff formatter to fix source code", use_vars = true }
rumdl-check = { cmd = "{rumdl-command}", help = "Run the rumdl markdown linting checks", use_vars = true }
rumdl-fix = { cmd = "{rumdl-command-fix}", help = "Run the rumdl markdown linter to fix markdown", use_vars = true }
mypy = { cmd = "{mypy-command}", help = "Run the mypy type checker for potential type errors", use_vars = true }
ty = { cmd = "{ty-command}", help = "Run the ty type checker for potential type errors", use_vars = true }
pyrefly = { cmd = "{pyrefly-command}", help = "Run the pyrefly type checker for potential type errors", use_vars = true }
zuban = { cmd = "{zuban-command}", help = "Run the zuban type checker for potential type errors", use_vars = true }
symbex = "task symbex-typed && task symbex-documented"
symbex-typed = { cmd = "{symbex-typed-command}", help = "Run symbex for fully typed functions", use_vars = true }
symbex-documented = { cmd = "{symbex-documented-command}", help = "Run symbex for documentation", use_vars = true }
format = { cmd = "{ruff-format-command}", help = "Run the ruff formatter to check source code", use_vars = true }
format-fix = { cmd = "{ruff-fixformat-command}", help = "Run the ruff formatter to fix source code", use_vars = true }
comments-check = { cmd = "uv run -m scripts.ccl check {project} {tests} {scripts}", help = "Check that comments start with lowercase letters using Tree-sitter", use_vars = true }
comments-fix = { cmd = "uv run -m scripts.ccl fix {project} {tests} {scripts}", help = "Auto-fix comments that start with uppercase letters", use_vars = true }
vsc = { cmd = "uv run -m scripts.vsc check", help = "Check that the GatorGrade version in main.py matches the version in pyproject.toml", use_vars = true }
test-coverage-check = { cmd = "uv run python -m scripts.tsc --threshold {directtestedfailunder}", help = "Check that a minimum percentage of functions are directly tested", use_vars = true }
test-coverage-check-verbose = { cmd = "uv run python -m scripts.tsc --threshold {directtestedfailunder} --verbose", help = "Check function coverage with detailed analysis output", use_vars = true }
test = { cmd = "pytest -x -s -vv", help = "Run the pytest test suite using order randomization" }
test-parallel = { cmd = "pytest -x -s -vv -n auto -p no:sugar", help = "Run the pytest test suite with parallel execution and order randomization" }
test-parallel-not-random = { cmd = "pytest -x -s -vv -n auto -p no:randomly -p no:clarity", help = "Run the pytest test suite with parallel execution but without order randomization" }
test-silent = { cmd = "pytest -x --show-capture=no -n auto", help = "Run the pytest test suite without showing output" }
test-silent-not-random = { cmd = "pytest -x --show-capture=no -p no:randomly", help = "Run the pytest test suite without showing output and order randomization" }
test-coverage = { cmd = "pytest -s --cov=gatorgrade --cov-branch --cov-fail-under={coveragefailunder} --cov-report=term-missing tests/", help = "Run the pytest test suite with coverage tracking", use_vars = true }
test-not-propertybased = { cmd = "pytest -x -s -vv -m 'not propertybased'", help = "Run the pytest test suite without property-based tests" }
test-propertybased = { cmd = "pytest -x -s -vv -m propertybased", help = "Run only the property-based tests" }
test-not-autohint = { cmd = "pytest -x -s -vv -m 'not autohint'", help = "Run the pytest test suite without auto-hint tests" }
test-autohint = { cmd = "pytest -x -s -vv -m autohint", help = "Run only the auto-hint tests" }
test-not-random = { cmd = "pytest -x -s -vv -p no:randomly", help = "Run the pytest test suite without order randomization" }
test-flaky = { cmd = "pytest -x -s -vv --flakefighters", help = "Run the pytest test suite with flakefighters enabled" }
test-flaky-suppress = { cmd = "pytest -x -s -vv --flakefighters --suppress-flaky-failures-exit-code", help = "Run the pytest test suite with flakefighters suppressing flaky failure exit codes" }
markdownlint = { cmd = "markdownlint-cli2 '**.md' '#node_modules'", help = "Run the Markdown linter" }
cosmic-ray-init = { cmd = "{cosmic-ray-init-command}", help = "Initialize cosmic-ray mutation testing session", use_vars = true }
cosmic-ray-baseline = { cmd = "{cosmic-ray-baseline-command}", help = "Run cosmic-ray baseline tests", use_vars = true }
cosmic-ray-exec = { cmd = "{cosmic-ray-exec-command}", help = "Execute cosmic-ray mutation testing", use_vars = true }
cosmic-ray-report = { cmd = "{cosmic-ray-report-command}", help = "Generate cosmic-ray mutation testing report (JSON)", use_vars = true }
[tool.coverage.run]
source = ["gatorgrade"]
branch = true
omit = ["tests/*", "**/__init__.py"]
[tool.coverage.report]
fail_under = 95
show_missing = true
precision = 2
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]
[tool.pytest.ini_options]
markers = [
"propertybased: property-based tests using hypothesis",
"autohint: tests that exercise the optional auto-hint extra",
]
[tool.ruff]
line-length = 79
lint.ignore = [
"D203", # do not check blank lines
"D213", # do not check multi-line docstrings
"E501", # do not check line length
]
lint.select = [
"E", # pycodestyle
"D", # pydocstyle
"I", # isort
"F", # pyflakes
"PL", # pylint
"Q", # flake8-quotes
"RUF", # ruff-specific
"W", # pycodestyle warnings
"T201" # flake8-print
]
[tool.isort]
include_trailing_comma = true
force_single_line = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 88
[tool.mypy]
ignore_missing_imports = true
strict = false
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
[tool.pyrefly]
preset = "legacy"
ignore-missing-imports = ["*"]