-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpyproject.toml
312 lines (286 loc) · 9.04 KB
/
pyproject.toml
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# SPDX-License-Identifier: FSFAP
# Copyright (C) 2020-2023 Andrew Rechnitzer
# Copyright (C) 2020-2025 Colin B. Macdonald
# Copyright (C) 2021 Nicholas J H Lai
# Copyright (C) 2022 Elizabeth Xiao
# Copyright (C) 2022 Natalia Accomazzo Scotti
# Copyright (C) 2022-2024 Edith Coates
# Copyright (C) 2023 Julian Lapenna
# Copyright (C) 2023 Divy Patel
# Copyright (C) 2023 Natalie Balashov
# Copyright (C) 2024 Bryan Tanady
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
[build-system]
requires = ['pip>=20.3', 'setuptools>=61', 'wheel']
build-backend = 'setuptools.build_meta'
[project]
name = 'plom'
description = 'Plom is Paperless Open Marking'
authors = [
{name = 'Andrew Rechnitzer'},
{name = 'Colin B. Macdonald'},
]
license = {text = 'AGPLv3+'}
classifiers=[
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Topic :: Education :: Testing",
"Development Status :: 3 - Alpha",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = ['version']
requires-python = '>=3.10'
# note aiohttp and peewee are legacy deps only
# pyopenssl is not a direct dependency but old versions caused trouble: Issue #3150
dependencies = [
"aiohttp>=3.7.2",
"arrow>=1.1.1",
"canvasapi>=3.0.0",
"cryptography>=41.0.3",
"pyOpenSSL>=23.2.0",
"django>=4.2.6",
"django-braces>=1.15.0",
"django-filter>=23.2",
"django-htmx>=1.14.0",
"django-mathfilters>=1.0.0",
"django-huey>=1.1.1",
"django-polymorphic>=3.1.0",
"django-reset-migrations>=0.4.0",
"django-session-timeout>=0.1.0",
"djangorestframework>=3.14.0",
"django-tables2>=2.7.0",
"exif>=1.2.2",
"gunicorn>=21.1.0",
"imutils>=0.5.4",
"matplotlib>=3.5.3",
"model_bakery>=1.11.0",
"numpy>=1.21.2",
"opencv-python-headless>=4.5.4.60",
"packaging",
"pandas>=1.5.0",
"passlib",
"peewee>=3.13.3",
"Pillow>=10.2",
"platformdirs>=3.0.0",
"pymupdf>=1.24.8",
"PyMySQL>=1.0.2",
"pyspellchecker>=0.8.1",
"pytest>=7.2.0",
"pytest-qt>=4.2.0",
"PyQt6>=6.2.0",
"psycopg2-binary>=2.9.6",
"random-username>=1.0.2",
"requests",
"requests-toolbelt",
"scikit-learn>=1.0.2",
"scipy>=1.8.1",
"seaborn>=0.12.2",
"segno>=1.5.2",
"stdiomask>=0.0.6",
"tabulate>=0.9.0",
'tomli>=2.0.1 ; python_version<"3.11"', # until we drop 3.10
"tomlkit>=0.11.7",
"tqdm>=4.63.2",
"weasyprint>=57.0",
"whitenoise>=6.4.0",
"zipfly>=6.0.1",
"zxing-cpp>=1.4.0",
# "nplusone>=1.0.0",
# "django-silk>=5.2.0",
]
# TODO: how to get "or"?: https://gitlab.com/plom/plom/-/issues/1570
# "file-magic || python-magic>=0.4.20",
# Non-Python deps for server
# - imagemagick (legacy)
# - ghostscript (optional, legacy)
# - latex installation including (Debian/Ubuntu pkg names):
# texlive-latex-extra dvipng latexmk texlive-fonts-recommended
# - latex installation including (Fedora pkg names):
# tex-preview tex-dvipng texlive-scheme-basic tex-charter
readme = {file = 'README.md', content-type = 'text/markdown'}
[project.urls]
Homepage = "https://plomgrading.org"
Repository = "https://gitlab.com/plom/plom"
'Bug Tracker' = "https://gitlab.com/plom/plom/-/issues"
Documentation = "https://plom.readthedocs.org"
Changelog = "https://gitlab.com/plom/plom/-/blob/main/CHANGELOG.md"
# [project.optional-dependencies]
# [tool.setuptools]
# zip-safe = true
[tool.setuptools]
packages = [
"plom",
"plom.cli",
"plom.create",
"plom.create.fonts",
"plom.scan",
"plom.finish",
"plom.client",
"plom.client.ui_files",
"plom.client.tools",
"plom.client.icons",
"plom.client.cursors",
"plom.client.help_img",
"plom.manager",
"plom.server",
"plom.server.plomServer",
"plom.db",
"plom.demo",
"plom.idreader",
"plom.solutions",
"plom.canvas",
"plom.scripts",
]
# somewhat deprecated? not supposed to package things into share?
# https://blog.raek.se/2022/10/31/os-integration-files-in-python-packages/u
[tool.setuptools.data-files]
"share/plom" = [
"plom/templateTestSpec.toml",
"plom/templateSolutionSpec.toml",
"plom/templateUserList.csv",
"plom/demoClassList.csv",
"plom/demo_rubrics.toml",
"plom/create/extra_pages_src.tex",
"plom/create/scrap_paper_src.tex",
"plom/create/bundle_separator_src.tex"
]
"share/plom/testTemplates" = ["testTemplates/*"]
# "share/plom/contrib", ["contrib/**/*"]
"share/plom/contrib" = [
"contrib/README.txt",
"contrib/plom-return_codes_to_canvas_csv.py",
"contrib/plom-write_grades_to_canvas_csv.py",
"contrib/upload_hw_from_zip_of_jpegs.py",
"contrib/plom-push-to-canvas.py"
]
[tool.setuptools.dynamic]
version = {attr = 'plom.__version__'}
[project.scripts]
# plom-client = "plom.client.__main__:main"
plom-demo = "plom.demo.__main__:main"
plom-hwdemo = "plom.scripts.hwdemo:main"
plom-create = "plom.create.__main__:main"
plom-server = "plom.server.__main__:main"
plom-legacy-server = "plom.server.__main__:main"
plom-scan = "plom.scan.__main__:main"
plom-manager = "plom.manager.__main__:main"
plom-legacy-manager = "plom.manager.__main__:main"
plom-finish = "plom.finish.__main__:main"
plom-hwscan = "plom.scripts.hwscan:main"
plom-solutions = "plom.solutions.__main__:main"
# TODO: move to plom_server.Launcher... waiting on Issue #3377.
plom-new-server = "plom.scripts.newserver:main"
plom-cli = "plom.cli.__main__:main"
# Tooling configuration
[tool.black]
line-length = 88
target-version = ["py310"]
[tool.pylint.main]
extension-pkg-allow-list = ["PyQt6", "cv2", "zxingcpp"]
generated-members = ["pandas", "cv2.*"]
# order matters: need errors-only before disable
errors-only = true
# TODO: lots of not-an-iterable in plom/db
# TODO: lots of no-member in plom_server
disable = ["not-an-iterable", "no-member"]
output-format = "colorized"
# we have some in-tree deprecated or to-move code that needs tensorflow
ignored-modules = ["tensorflow", "api_secrets"]
[tool.coverage.report]
# our CI runs /usr/local stuff for some reason
# python*.py errors need -i or config match here
omit = ["*/test_*", "/usr/*", "*/config*"]
[tool.pytest.ini_options]
# TODO: for now ignore the plom_server folder: it uses its own testing
addopts = "--ignore plom_server"
qt_api = "pyqt6"
[tool.djlint]
# TODO: fix then remove from ignore list: H006, H013
ignore="H006,H013,H021,H023,H030,H031"
# indent=2
[tool.mypy]
# pretty = true
exclude = [
'digitHunter.py',
]
# These avoid mypy errors: mostly libraries that don't yet have typing
# Maintenance: try removing X, removing .mypy_cache, uninstalling types-X, and rerunning mypy locally
[[tool.mypy.overrides]]
module = [
'api_secrets',
'canvasapi',
'exif',
'imutils.*',
'requests_toolbelt',
'sklearn.*',
'stdiomask',
'zxingcpp',
'braces.*',
'django.*',
'django_huey',
'django_tables2',
'huey.*',
'matplotlib.*',
'polymorphic.models',
'pymupdf',
'random_username.generate',
'rest_framework.*',
'scipy.optimize',
'seaborn',
'weasyprint',
'whitenoise',
'zipfly',
]
ignore_missing_imports = true
# hide some things from mypy
# - examDB and theServer have strange/confusing import patterns
# - tool.py has pyqtProperty stuff that is also confusing to me
# - TODO: fix the temporary ones for Issue #2847 and Issue #2849
[[tool.mypy.overrides]]
module = [
'plom.client.tools.tool',
'plom.db.examDB',
'plom.server.theServer',
]
ignore_errors = true
[tool.pyright]
pythonVersion = "3.12"
exclude = ['plom/manager', 'plom/server', '**/_digitHunter.py']
# changing to "off" makes this much quieter
typeCheckingMode = "basic"
# lots of Django false positives?
reportAttributeAccessIssue = false
[tool.codespell]
skip = "*.po,*.ts,*.pdf,*.png,*.jpg,*.svg,*.csv,*.json,.git"
count = true
check-filenames = true
check-hidden = true
quiet-level = 3
ignore-words = ".codespell-ignorewords"
exclude-file = ".codespell-ignorelines"
[tool.ruff.lint]
# enable docstring checking and import reordering
# select = ["D", "I"] # TODO: later?
select = ["D"]
# D107: perhaps init methods don't need docstrings
# D100: public module docstrings: seem to get a lot of false positives
# D10x: most of these are about missing docstrings
ignore = ["D107", "D100", "D101", "D102", "D103", "D104", "D106"]
# Legacy stuff: would need lots of edits to pass
exclude = ["plom/server/**", "plom/db/**", "plom/canvas/**"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
# F401: defining __all__ might be right fix
# E402, I001: re-ordering causes circular imports
'__init__.py' = ['F401', 'E402', 'I001']
# tests don't need docstrings
'plom*/**/test*.py' = ['D100', 'D101', 'D102', 'D103', 'D104']