Skip to content

Commit 4aecb18

Browse files
committed
Merged
2 parents 7a2d529 + 342d35d commit 4aecb18

File tree

2 files changed

+51
-112
lines changed

2 files changed

+51
-112
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
# https://pre-commit.ci/
33
# Configuration for Continuous Integration service
44
ci:
5-
# Can't run Windows scons scripts on Linux.
6-
# unit testing requires our python environment,
7-
# which cannot be configured with pre-commit.ci:
8-
# https://stackoverflow.com/questions/70778806/pre-commit-not-using-virtual-environment .
9-
# Can't run licenseCheck as it relies on telemetry,
10-
# which CI blocks.
115
skip: [pyrightLocal]
126
autoupdate_schedule: monthly
137
autoupdate_commit_msg: "Pre-commit auto-update"
@@ -34,13 +28,10 @@ repos:
3428
rev: v5.0.0
3529
hooks:
3630
# Prevents commits to certain branches
37-
# - id: no-commit-to-branch
38-
# args: ["--branch", "main"]
31+
- id: no-commit-to-branch
32+
args: ["--branch", "main"]
3933
# Checks that large files have not been added. Default cut-off for "large" files is 500kb.
4034
- id: check-added-large-files
41-
# POFiles and TTF fonts can't be made smaller
42-
exclude_types: ["pofile", "ttf"]
43-
# Same applies for NVDA dictionary (.dic) files and Spline Font Database (.SFD) files, but these aren't recognised by the Identify library.
4435
# Checks python syntax
4536
- id: check-ast
4637
# Checks for filenames that will conflict on case insensitive filesystems (the majority of Windows filesystems, most of the time)
@@ -68,7 +59,6 @@ repos:
6859
- id: check-vcs-permalinks
6960
# Avoids using reserved Windows filenames.
7061
- id: check-illegal-windows-names
71-
args: ["--unittest"]
7262

7363
- repo: https://github.com/asottile/add-trailing-comma
7464
rev: v3.1.0
@@ -104,3 +94,4 @@ repos:
10494
# use nodejs version of pyright and install pyproject.toml for CI
10595
additional_dependencies: [".", "pyright[nodejs]"]
10696
stages: [manual] # Only run from CI manually
97+

pyproject.toml

Lines changed: 48 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies = [
2525
]
2626

2727
[project.urls]
28-
Repository = "https://github.com/nvaccess/MathCATForPython.git"
28+
Repository = "http://github.com/NSoiffer/MathCATForPython"
2929

3030
[tool.ruff]
3131
line-length = 110
@@ -43,9 +43,7 @@ builtins = [
4343

4444
include = [
4545
"*.py",
46-
"*.pyw",
4746
"sconstruct",
48-
"*sconscript",
4947
]
5048

5149
exclude = [
@@ -73,22 +71,6 @@ logger-objects = ["logHandler.log"]
7371
# sconscripts contains many inbuilt functions not recognised by the lint,
7472
# so ignore F821.
7573
"sconstruct" = ["F821"]
76-
"*sconscript" = ["F821"]
77-
78-
[tool.ruff.lint.flake8-tidy-imports.banned-api]
79-
"winsound.PlaySound".msg= "PlaySound uses winmm, which is deprecated in favor of the Windows core audio APIs."
80-
81-
[tool.licensecheck]
82-
only_licenses = ["BSD", "MIT", "Python", "LGPLV3+", "Apache"]
83-
ignore_packages = [
84-
# Compatible licenses:
85-
"certifi", # Mozilla Public License 2.0
86-
"markdown-link-attr-modifier", # GPLV3 license, but not in PyPI correctly
87-
"pycaw", # MIT license, but not in PyPI
88-
"urllib3", # MIT license, but not in PyPI
89-
"wxPython", # wxWindows Library License
90-
]
91-
9274

9375
[tool.pyright]
9476
venvPath = ".venv"
@@ -98,12 +80,10 @@ typeCheckingMode = "strict"
9880

9981
include = [
10082
"**/*.py",
101-
"**/*.pyw",
10283
]
10384

10485
exclude = [
10586
"sconstruct",
106-
"*sconscript",
10787
".git",
10888
"__pycache__",
10989
".venv",
@@ -163,100 +143,68 @@ reportUnusedCoroutine = true
163143
reportUnusedExcept = true
164144

165145
# Should switch to true when possible
166-
reportDeprecated = false # 1834 errors
146+
reportDeprecated = false
167147

168148
# Can be enabled by generating type stubs for modules via pyright CLI
169149
reportMissingTypeStubs = false
170150

171-
# Bad rules
172-
# These are roughly sorted by compliance to make it easier for devs to focus on enabling them.
173-
# Errors were last checked Feb 2025.
174-
# 1-50 errors
175-
reportUnsupportedDunderAll = false # 2 errors
176-
reportAbstractUsage = false # 3 errors
177-
reportUntypedBaseClass = false # 4 errors
178-
reportOptionalIterable = false # 5 errors
179-
reportCallInDefaultInitializer = false # 6 errors
180-
reportInvalidTypeArguments = false # 7 errors
181-
reportUntypedNamedTuple = false # 11 errors
182-
reportRedeclaration = false # 12 errors
183-
reportOptionalCall = false # 16 errors
184-
reportConstantRedefinition = false # 18 errors
185-
reportWildcardImportFromLibrary = false # 26 errors
186-
reportIncompatibleVariableOverride = false # 28 errors
187-
reportInvalidTypeForm = false # 38 errors
188-
189-
190-
# 50-100 errors
191-
reportGeneralTypeIssues = false # 53 errors
192-
reportOptionalOperand = false # 59 errors
193-
reportUnnecessaryComparison = false # 67 errors
194-
reportFunctionMemberAccess = false # 80 errors
195-
reportUnnecessaryIsInstance = false # 88 errors
196-
reportUnusedFunction = false # 97 errors
197-
reportImportCycles = false # 99 errors
198-
reportUnusedImport = false # 113 errors
199-
reportUnusedVariable = false # 147 errors
200-
201-
# 100-1000 errors
202-
reportOperatorIssue = false # 102 errors
203-
reportAssignmentType = false # 103 errors
204-
reportReturnType = false # 104 errors
205-
reportPossiblyUnboundVariable = false # 126 errors
206-
reportMissingSuperCall = false # 159 errors
207-
reportUninitializedInstanceVariable = false # 179 errors
208-
reportUnknownLambdaType = false # 196 errors
209-
reportMissingTypeArgument = false # 204 errors
210-
reportImplicitStringConcatenation = false # 300+ errors
211-
reportIncompatibleMethodOverride = false # 300+ errors
212-
reportPrivateUsage = false # 900+ errors
213-
214-
# 1000+ errors
215-
reportUnusedCallResult = false # 1000+ errors
216-
reportOptionalSubscript = false # 1000+ errors, mostly failing to recognize config setter/getter
217-
reportCallIssue = false # 1000+ errors, mostly failing to recognize config setter/getter
218-
reportOptionalMemberAccess = false # 1683 errors
219-
reportImplicitOverride = false # 2000+ errors
220-
reportIndexIssue = false # 2000+ errors, mostly failing to recognize config setter/getter
221-
reportAttributeAccessIssue = false # 2000+ errors
222-
reportArgumentType = false # 2000+ errors
223-
reportUnknownParameterType = false # 4000+ errors
224-
reportMissingParameterType = false # 4000+ errors
225-
reportUnknownVariableType = false # 6000+ errors
226-
reportUnknownArgumentType = false # 6000+ errors
227-
reportUnknownMemberType = false # 20000+ errors
228-
229-
[tool.uv]
230-
default-groups = "all"
231-
python-preference = "only-system"
232-
environments = ["sys_platform == 'win32'"]
233-
234-
[tool.uv.sources]
235-
nvda-misc-deps = { workspace = true }
236-
configobj = { git = "https://github.com/DiffSK/configobj", rev = "8be54629ee7c26acb5c865b74c76284e80f3aa31" }
237-
238-
[tool.uv.workspace]
239-
members = [
240-
"miscDeps",
241-
]
151+
reportUnsupportedDunderAll = false
152+
reportAbstractUsage = false
153+
reportUntypedBaseClass = false
154+
reportOptionalIterable = false
155+
reportCallInDefaultInitializer = false
156+
reportInvalidTypeArguments = false
157+
reportUntypedNamedTuple = false
158+
reportRedeclaration = false
159+
reportOptionalCall = false
160+
reportConstantRedefinition = false
161+
reportWildcardImportFromLibrary = false
162+
reportIncompatibleVariableOverride = false
163+
reportInvalidTypeForm = false
164+
reportGeneralTypeIssues = false
165+
reportOptionalOperand = false
166+
reportUnnecessaryComparison = false
167+
reportFunctionMemberAccess = false
168+
reportUnnecessaryIsInstance = false
169+
reportUnusedFunction = false
170+
reportImportCycles = false
171+
reportUnusedImport = false
172+
reportUnusedVariable = false
173+
reportOperatorIssue = false
174+
reportAssignmentType = false
175+
reportReturnType = false
176+
reportPossiblyUnboundVariable = false
177+
reportMissingSuperCall = false
178+
reportUninitializedInstanceVariable = false
179+
reportUnknownLambdaType = false
180+
reportMissingTypeArgument = false
181+
reportImplicitStringConcatenation = false
182+
reportIncompatibleMethodOverride = false
183+
reportPrivateUsage = false
184+
reportUnusedCallResult = false
185+
reportOptionalSubscript = false
186+
reportCallIssue = false
187+
reportOptionalMemberAccess = false
188+
reportImplicitOverride = false
189+
reportIndexIssue = false
190+
reportAttributeAccessIssue = false
191+
reportArgumentType = false
192+
reportUnknownParameterType = false
193+
reportMissingParameterType = false
194+
reportUnknownVariableType = false
195+
reportUnknownArgumentType = false
196+
reportUnknownMemberType = false
242197

243198
[dependency-groups]
244199
dev = [
245-
"nvda-misc-deps",
246-
# NVDA's build system is SCons
247200
"SCons==4.8.1",
248-
# Packaging NVDA
249-
"py2exe==0.13.0.2",
250201
"setuptools~=72.0",
251202
]
252203
lint = [
253204
"ruff==0.8.1",
254205
"pre-commit==4.0.1",
255206
"pyright==1.1.396",
256207
]
257-
license-check = [
258-
"licensecheck==2024.3",
259-
]
260208

261209
[tool.setuptools.dynamic]
262210
version = {attr = "buildVersion.version_detailed"}

0 commit comments

Comments
 (0)