-
-
Notifications
You must be signed in to change notification settings - Fork 817
Expand file tree
/
Copy pathpyproject.toml
More file actions
429 lines (391 loc) · 12.1 KB
/
Copy pathpyproject.toml
File metadata and controls
429 lines (391 loc) · 12.1 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
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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
[build-system]
requires = ["setuptools~=80.10.2", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "nvda"
dynamic = ["version"]
description = "NonVisual Desktop Access (NVDA)"
maintainers = [
{name = "NV Access", email = "info@nvaccess.org"},
]
requires-python = ">=3.13,<3.14"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Topic :: Accessibility",
]
readme = "readme.md"
license = {file = "copying.txt"}
dependencies = [
# NVDA's runtime dependencies
"bleak==3.0.2",
"comtypes==1.4.13",
"cryptography==48.0.1",
"pyserial==3.5",
"wxPython==4.2.4",
# pinned to a commit in tool.uv.sources
"configobj",
"requests==2.33.0",
"url-normalize==2.2.1",
"schedule==1.2.2",
# NVDA_DMP requires diff-match-patch
"fast-diff-match-patch==2.1.0",
# pycaw is a Core Audio Windows Library used for sound split
"pycaw==20251023",
# NVDA bridge for 32 bit shim
"rpyc==6.0.2",
"pywin32==311",
# Sanitize HTML for browsable messages and documentation output to prevent XSS from translators
"nh3==0.3.2",
# l10nUtil requires Crowdin
"crowdin-api-client==1.24.1",
# fuzzy search
"fuzzysearch==0.8.1",
# Building user documentation and the l10nUtil
"Markdown==3.10",
"lxml==6.1.1",
"mdx_truly_sane_lists==1.3",
"markdown-link-attr-modifier==0.2.1",
"mdx-gh-links==0.4",
"l2m4m==1.0.4",
"pymdown-extensions==10.21.3",
"pyphen==0.17.2",
# secret scanning for logging
"detect-secrets==1.5.0",
"regex==2026.4.4",
]
[project.urls]
Homepage = "https://www.nvaccess.org/"
Repository = "https://github.com/nvaccess/nvda.git"
Issues = "https://github.com/nvaccess/nvda/issues"
[tool.ruff]
line-length = 110
builtins = [
# translation lookup
"_",
# translation lookup
"ngettext",
# translation lookup
"pgettext",
# translation lookup
"npgettext",
]
include = [
"*.py",
"*.pyw",
"sconstruct",
"*sconscript",
]
exclude = [
".git",
"__pycache__",
".tox",
"build",
"output",
".venv",
# When excluding concrete paths relative to a directory,
# not matching multiple folders by name e.g. `__pycache__`,
# paths are relative to the configuration file.
"./runtime-builders/synthDriverHost32/.venv",
"./include/*",
"./miscDeps",
"./source/louis",
# #10924: generated by third-party dependencies
"./source/comInterfaces/*",
# Code from add-ons
"./source/userConfig/addons/*",
]
[tool.ruff.format]
indent-style = "tab"
line-ending = "lf"
[tool.ruff.lint.mccabe]
max-complexity = 15
[tool.ruff.lint]
ignore = [
# indentation contains tabs
"W191",
]
logger-objects = ["logHandler.log"]
[tool.ruff.lint.per-file-ignores]
# sconscripts contains many inbuilt functions not recognised by the lint,
# so ignore F821.
"sconstruct" = ["F821"]
"*sconscript" = ["F821"]
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"winsound.PlaySound".msg= "PlaySound uses winmm, which is deprecated in favor of the Windows core audio APIs."
[tool.licensecheck]
only_licenses = ["BSD", "MIT", "Python", "LGPLV3+", "Apache"]
ignore_packages = [
# Compatible licenses:
"certifi", # Mozilla Public License 2.0
"Markdown", # BSD-3-Clause, but not in PyPI correctly
"markdown-link-attr-modifier", # GPLV3 license, but not in PyPI correctly
"pycaw", # MIT license, but not in PyPI
"wxPython", # wxWindows Library License
]
[tool.pyright]
venvPath = ".venv"
venv = "."
pythonPlatform = "Windows"
typeCheckingMode = "strict"
include = [
"**/*.py",
"**/*.pyw",
]
exclude = [
"sconstruct",
"*sconscript",
".git",
"__pycache__",
".tox",
"build",
"output",
".venv",
# When excluding concrete paths relative to a directory,
# not matching multiple folders by name e.g. `__pycache__`,
# paths are relative to the configuration file.
"./runtime-builders/synthDriverHost32/.venv",
"./include/*",
"./miscDeps",
"./source/louis",
# #10924: generated by third-party dependencies
"./source/comInterfaces/*",
# Code from add-ons
"./source/userConfig/addons/*",
]
# While exclude tells pyright not to scan files in the first instance,
# it will still analyse files included by other files.
ignore = [
# We do not care about errors in our dependencies.
".venv",
]
# Tell pyright where to load python code from
extraPaths = [
"./source",
# Used by system tests
"./tests/system/libraries",
# Used internally in NVDA
"./miscDeps/python",
"./include/nvda-mathcat/assets",
]
# General config
analyzeUnannotatedFunctions = true
deprecateTypingAliases = true
# Stricter typing
strictParameterNoneValue = true
strictListInference = true
strictDictionaryInference = true
strictSetInference = true
# Compliant rules
reportAssertAlwaysTrue = true
reportAssertTypeFailure = true
reportDuplicateImport = true
reportIncompleteStub = true
reportInconsistentOverload = true
reportInconsistentConstructor = true
reportInvalidStringEscapeSequence = true
reportInvalidStubStatement = true
reportInvalidTypeVarUse = true
reportMatchNotExhaustive = true
reportMissingModuleSource = true
reportMissingImports = true
reportNoOverloadImplementation = true
reportOptionalContextManager = true
reportOverlappingOverload = true
reportPrivateImportUsage = true
reportPropertyTypeMismatch = true
reportSelfClsParameterName = true
reportTypeCommentUsage = true
reportTypedDictNotRequiredAccess = true
reportUndefinedVariable = true
reportUnusedExpression = true
reportUnboundVariable = true
reportUnhashable = true
reportUnnecessaryCast = true
reportUnnecessaryContains = true
reportUnnecessaryTypeIgnoreComment = true
reportUntypedClassDecorator = true
reportUntypedFunctionDecorator = true
reportUnusedClass = true
reportUnusedCoroutine = true
reportUnusedExcept = true
# Should switch to true when possible
reportDeprecated = false # 1834 errors
# Can be enabled by generating type stubs for modules via pyright CLI
reportMissingTypeStubs = false
# Bad rules
# These are roughly sorted by compliance to make it easier for devs to focus on enabling them.
# Errors were last checked Feb 2025.
# 1-50 errors
reportUnsupportedDunderAll = false # 2 errors
reportAbstractUsage = false # 3 errors
reportUntypedBaseClass = false # 4 errors
reportOptionalIterable = false # 5 errors
reportCallInDefaultInitializer = false # 6 errors
reportInvalidTypeArguments = false # 7 errors
reportUntypedNamedTuple = false # 11 errors
reportRedeclaration = false # 12 errors
reportOptionalCall = false # 16 errors
reportConstantRedefinition = false # 18 errors
reportWildcardImportFromLibrary = false # 26 errors
reportIncompatibleVariableOverride = false # 28 errors
reportInvalidTypeForm = false # 38 errors
# 50-100 errors
reportGeneralTypeIssues = false # 53 errors
reportOptionalOperand = false # 59 errors
reportUnnecessaryComparison = false # 67 errors
reportFunctionMemberAccess = false # 80 errors
reportUnnecessaryIsInstance = false # 88 errors
reportUnusedFunction = false # 97 errors
reportImportCycles = false # 99 errors
reportUnusedImport = false # 113 errors
reportUnusedVariable = false # 147 errors
# 100-1000 errors
reportOperatorIssue = false # 102 errors
reportAssignmentType = false # 103 errors
reportReturnType = false # 104 errors
reportPossiblyUnboundVariable = false # 126 errors
reportMissingSuperCall = false # 159 errors
reportUninitializedInstanceVariable = false # 179 errors
reportUnknownLambdaType = false # 196 errors
reportMissingTypeArgument = false # 204 errors
reportImplicitStringConcatenation = false # 300+ errors
reportIncompatibleMethodOverride = false # 300+ errors
reportPrivateUsage = false # 900+ errors
# 1000+ errors
reportUnusedCallResult = false # 1000+ errors
reportOptionalSubscript = false # 1000+ errors, mostly failing to recognize config setter/getter
reportCallIssue = false # 1000+ errors, mostly failing to recognize config setter/getter
reportOptionalMemberAccess = false # 1683 errors
reportImplicitOverride = false # 2000+ errors
reportIndexIssue = false # 2000+ errors, mostly failing to recognize config setter/getter
reportAttributeAccessIssue = false # 2000+ errors
reportArgumentType = false # 2000+ errors
reportUnknownParameterType = false # 4000+ errors
reportMissingParameterType = false # 4000+ errors
reportUnknownVariableType = false # 6000+ errors
reportUnknownArgumentType = false # 6000+ errors
reportUnknownMemberType = false # 20000+ errors
[tool.ty.environment]
python = ".venv"
python-platform = "win32"
# Tell ty where to load python code from (ported from pyright's extraPaths).
extra-paths = [
"./source",
# Used by system tests
"./tests/system/libraries",
# Used internally in NVDA
"./miscDeps/python",
"./include/nvda-mathcat/assets",
]
[tool.ty.src]
# Appended to ty's default excludes (which already cover e.g. .git, .venv and __pycache__ at any depth).
# Patterns are anchored to the project root.
exclude = [
"build",
"output",
"./include/*",
"./miscDeps",
"./source/louis",
# #10924: generated by third-party dependencies
"./source/comInterfaces/*",
# Code from add-ons
"./source/userConfig/addons/*",
]
[tool.ty.terminal]
output-format = "concise"
[tool.ty.rules]
# ty (Astral's type checker) runs in parallel with pyright during the transition.
# To keep current code typing unchanged, rules that flood on the existing codebase
# are set to "ignore" (ty's rule taxonomy differs from pyright's, so this is
# analogous to, not a mirror of, the leniency configured in [tool.pyright]).
unresolved-attribute = "ignore" # 3813 errors
not-subscriptable = "ignore" # 1118 errors
invalid-argument-type = "ignore" # 953 errors
invalid-assignment = "ignore" # 455 errors
unsupported-operator = "ignore" # 119 errors
invalid-method-override = "ignore" # 113 errors
invalid-return-type = "ignore" # 103 errors
invalid-type-form = "ignore" # 37 errors
call-non-callable = "ignore" # 32 errors
missing-argument = "ignore" # 23 errors
not-iterable = "ignore" # 22 errors
no-matching-overload = "ignore" # 18 errors
# Unresolvable modules: generated COM stubs, optional native deps (brlapi,
# libmathcat_py), build-generated _buildVersion, and namespace-package quirks.
unresolved-import = "ignore" # 13 errors
invalid-parameter-default = "ignore" # 11 errors
invalid-yield = "ignore" # 10 errors
unknown-argument = "ignore" # 10 errors
too-many-positional-arguments = "ignore" # 6 errors
invalid-super-argument = "ignore" # 3 errors
call-top-callable = "ignore" # 2 errors
invalid-attribute-access = "ignore" # 1 error
empty-body = "ignore" # 1 error
shadowed-type-variable = "ignore" # 1 error
invalid-attribute-override = "ignore" # 1 error
# Non-fatal warnings, ignored for the same reason as the errors above (ty 0.0.57).
possibly-missing-submodule = "ignore" # 48 warnings
deprecated = "ignore" # 24 warnings
invalid-enum-member-annotation = "ignore" # 6 warnings
unused-type-ignore-comment = "ignore" # 1 warning
unsupported-base = "ignore" # 1 warning
redundant-cast = "ignore" # 1 warning
mismatched-type-name = "ignore" # 1 warning
[tool.uv]
default-groups = "all"
python-preference = "only-system"
environments = ["sys_platform == 'win32'"]
required-version = ">=0.9"
[tool.setuptools]
package-dir = {"" = "source"}
[tool.uv.sources]
nvda-misc-deps = { workspace = true }
configobj = { git = "https://github.com/DiffSK/configobj", rev = "9c8a0a80c767bf8a3d6493ed01df6c351bddca42" }
nvda-mathcat = { workspace = true }
[tool.uv.workspace]
members = [
"miscDeps",
"include/nvda-mathcat",
]
[dependency-groups]
dev = [
"nvda-misc-deps",
# NVDA's build system is SCons
"SCons==4.10.1",
# Packaging NVDA
"py2exe==0.14.1.1",
"setuptools~=80.10.2",
"nvda-mathcat",
"uv==0.11.29",
]
lint = [
"ruff==0.15.9",
"prek==0.4.4",
"pyright[nodejs]==1.1.407",
"ty==0.0.60",
]
license-check = [
"licensecheck==2025.1",
]
dev-docs = [
# For building developer documentation
"sphinx==8.1.3",
"sphinx_rtd_theme==3.0.1",
]
system-tests = [
"robotframework==7.3.2",
"robotremoteserver==1.1.1",
"robotframework-screencaplibrary==1.6.0",
]
unit-tests = [
# Creating XML unit test reports
"unittest-xml-reporting==3.2.0",
# Feed parameters to tests neatly
"parameterized==0.9.0",
]
[tool.setuptools.dynamic]
version = {attr = "buildVersion.version_detailed"}