Skip to content

Commit 26c30b5

Browse files
Add an initial pyright configuration (#12924)
Co-authored-by: Adam Turner <[email protected]>
1 parent 0a162fa commit 26c30b5

File tree

3 files changed

+81
-0
lines changed

3 files changed

+81
-0
lines changed

.github/workflows/lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,26 @@ jobs:
8383
- name: Type check with mypy
8484
run: mypy
8585

86+
pyright:
87+
runs-on: ubuntu-latest
88+
89+
steps:
90+
- uses: actions/checkout@v4
91+
- name: Set up Python
92+
uses: actions/setup-python@v5
93+
with:
94+
python-version: "3"
95+
- name: Install uv
96+
run: >
97+
curl --no-progress-meter --location --fail
98+
--proto '=https' --tlsv1.2
99+
"https://astral.sh/uv/install.sh"
100+
| sh
101+
- name: Install dependencies
102+
run: uv pip install ".[lint,test]"
103+
- name: Type check with pyright
104+
run: pyright
105+
86106
docs-lint:
87107
runs-on: ubuntu-latest
88108

pyproject.toml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ lint = [
9292
"types-requests==2.32.0.20240914", # align with requests
9393
"types-urllib3==1.26.25.14",
9494
"tomli>=2", # for mypy (Python<=3.10)
95+
"pyright==1.1.382.post0",
9596
"pytest>=6.0",
9697
]
9798
test = [
@@ -303,3 +304,62 @@ exclude_lines = [
303304
'if __name__ == .__main__.:',
304305
]
305306
ignore_errors = true
307+
308+
[tool.pyright]
309+
typeCheckingMode = "strict"
310+
include = [
311+
"doc/conf.py",
312+
"utils",
313+
"sphinx",
314+
"tests",
315+
]
316+
317+
reportArgumentType = "none"
318+
reportAssignmentType = "none"
319+
reportAttributeAccessIssue = "none"
320+
reportCallIssue = "none"
321+
reportConstantRedefinition = "none"
322+
reportDeprecated = "none"
323+
reportGeneralTypeIssues = "none"
324+
reportIncompatibleMethodOverride = "none"
325+
reportIncompatibleVariableOverride = "none"
326+
reportInconsistentOverload = "none"
327+
reportIndexIssue = "none"
328+
reportInvalidTypeArguments = "none"
329+
reportInvalidTypeForm = "none"
330+
reportInvalidTypeVarUse = "none"
331+
reportMissingImports = "none"
332+
reportMissingModuleSource = "none"
333+
reportMissingParameterType = "none"
334+
reportMissingTypeArgument = "none"
335+
reportMissingTypeStubs = "none"
336+
reportOperatorIssue = "none"
337+
reportOptionalIterable = "none"
338+
reportOptionalMemberAccess = "none"
339+
reportOptionalOperand = "none"
340+
reportOptionalSubscript = "none"
341+
reportPossiblyUnboundVariable = "none"
342+
reportPrivateUsage = "none"
343+
reportRedeclaration = "none"
344+
reportReturnType = "none"
345+
reportSelfClsParameterName = "none"
346+
reportTypeCommentUsage = "none"
347+
reportTypedDictNotRequiredAccess = "none"
348+
reportUndefinedVariable = "none"
349+
reportUnknownArgumentType = "none"
350+
reportUnknownLambdaType = "none"
351+
reportUnknownMemberType = "none"
352+
reportUnknownParameterType = "none"
353+
reportUnknownVariableType = "none"
354+
reportUnnecessaryComparison = "none"
355+
reportUnnecessaryContains = "none"
356+
reportUnnecessaryIsInstance = "none"
357+
reportUnsupportedDunderAll = "none"
358+
reportUntypedBaseClass = "none"
359+
reportUntypedFunctionDecorator = "none"
360+
reportUntypedNamedTuple = "none"
361+
reportUnusedClass = "none"
362+
reportUnusedFunction = "none"
363+
reportUnusedImport = "none"
364+
reportUnusedVariable = "none"
365+
reportWildcardImportFromLibrary = "none"

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ commands =
3939
ruff check . --output-format github
4040
flake8 .
4141
mypy
42+
pyright
4243

4344
[testenv:docs]
4445
description =

0 commit comments

Comments
 (0)