Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
128 lines (112 loc) · 3.74 KB
/
Copy pathpyproject.toml
File metadata and controls
128 lines (112 loc) · 3.74 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
[project]
name = "pytest-prairielearn-grader"
dynamic = ["version"]
description = "A pytest plugin for autograding Python code. Designed for use with the PrairieLearn platform."
readme = "README.md"
authors = [{ name = "Eliot Robson", email = "eliot.robson24@gmail.com" }]
requires-python = ">=3.11"
dependencies = ["dill>=0.4.0", "pytest", "prettytable>=3.8.0"]
license = { file = "LICENSE" }
classifiers = [
"Development Status :: 3 - Alpha",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
[project.optional-dependencies]
notebook = ["nbformat>=5.0"]
[project.urls]
repository = "https://github.com/eliotwrobson/pl-python-autograder-v2"
[dependency-groups]
dev = [
"numpy>=2.0",
"pandas>=2.0",
"mypy",
"ruff>=0.11.12",
"sympy",
"pandas-stubs",
"matplotlib-stubs",
"matplotlib",
"matplotcheck2>=0.2.1",
"networkx",
"types-networkx",
"nbformat>=5.0",
]
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "uv-dynamic-versioning"
[tool.uv-dynamic-versioning]
fallback-version = "0.0.0"
[tool.ruff]
line-length = 140
src = ["src", "tests"]
target-version = "py310"
extend-exclude = [
# Notebook submissions, whose cells start with tags such as "#grade" that the formatter would change.
"tests/scenario_root/**/*.ipynb",
# These files test how the grader handles syntax errors, so they can't be parsed.
"tests/scenario_root/test_helper_modules_syntax_error/helper_function.py",
"tests/scenario_root/test_module_sandbox_init_error/student_code.py",
"tests/scenario_root/test_syntax_error_ungradable/student_code.py",
]
[tool.ruff.lint]
ignore = [
"RUF001", # ruff-specific rules ambiguous-unicode-character-string
"S101", # flake8-bandit assert
"S308", # flake8-bandit suspicious-mark-safe-usage
"E501", # pycodestyle line-too-long
"PT011",
"PT013",
"S603",
"S607",
]
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"E", # pycodestyle errors
"EXE", # flake8-executable
"F", # pyflakes
"I", # isort
"INT", # flake8-gettext
"PIE", # flake8-pie
"PLC", # pylint convention
"PLE", # pylint errors
"PT", # flake8-pytest-style
# "PTH", # flake8-use-pathlib
"RSE", # flake8-raise
"RUF", # ruff-specific rules
"S", # flake8-bandit
"UP", # pyupgrade
"W", # pycodestyle warnings
]
[tool.ruff.lint.per-file-ignores]
# numpy and pandas aren't installed in the lite image, so they're imported only when needed.
"src/pytest_prairielearn_grader/json_utils.py" = ["PLC0415"]
# Stand-ins for student code: they use names that the sandbox injects, import inside functions to
# test import restrictions, and evaluate expressions to test the sandbox.
"tests/scenario_root/**" = ["F821", "PLC0415", "B018"]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.lint.isort]
forced-separate = ["conftest"]
force-single-line = true
[project.entry-points.pytest11]
prairielearn-grader = "pytest_prairielearn_grader.plugin"
# TODO uncomment to add a separate CLI entrypoint.
# [project.scripts]
# prairielearn-pytest-autograder = "pytest_prairielearn_grader.cli:main"
[tool.mypy]
exclude = [
"tests/scenario_root/.*(student_code.*|setup_code)\\.py",
"tests/scenario_root/.*/student/.*\\.py",
"tests/scenario_root/test_helper_modules[^/]*/(helper_function|second_helper|leading_code)\\.py",
]
[[tool.mypy.overrides]]
module = ["sympy.*", "dill.*"]
ignore_missing_imports = true