Skip to content

Commit 0142daf

Browse files
committed
pyproject: Configure mypy and pyright
Signed-off-by: Philipp Hahn <[email protected]>
1 parent 037a5ee commit 0142daf

File tree

3 files changed

+23
-4
lines changed

3 files changed

+23
-4
lines changed

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@ MANIFEST
1010
*.egg-info
1111
.vscode
1212
temp
13-
14-
15-
16-
13+
mypy.junit.xml
14+
mypy/

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ recursive-include examples *.py *.elf *.out
44
recursive-include test *
55
global-exclude *.py[cod]
66
global-exclude __pycache__
7+
global-exclude .mypy_cache
78
include README.rst
89
include LICENSE
910
include CHANGES

pyproject.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ Homepage = "https://github.com/eliben/pyelftools"
4242
Repository = "https://github.com/eliben/pyelftools.git"
4343
Issues = "https://github.com/eliben/pyelftools/issues"
4444

45+
[dependency-groups]
46+
typing = ["mypy[reports]", "pyright", "typeguard"]
47+
4548
[tool.setuptools]
4649
packages = [
4750
"elftools",
@@ -64,3 +67,20 @@ version = {attr = "elftools.__version__"}
6467

6568
[tool.setuptools.package-data]
6669
elftools = ["py.types"]
70+
71+
[tool.mypy]
72+
error_summary = false
73+
disallow_any_generics = true
74+
disallow_untyped_defs = true
75+
disallow_incomplete_defs = true
76+
warn_redundant_casts = true
77+
warn_unused_ignores = true
78+
# html_report = "mypy"
79+
packages = "elftools"
80+
# junit_xml = "mypy.junit.xml"
81+
junit_format = "per_file"
82+
83+
[tool.pyright]
84+
include = [
85+
"elftools",
86+
]

0 commit comments

Comments
 (0)