Skip to content

Commit 137ec3f

Browse files
committed
mypy: Move configuration to pyproject.toml
For consistency with other projects. We also start following imports, which avoids weirdness where we modify a single file that relies on type hints from another for proper function. Change-Id: I12ca6baac2498efc920c570a3bcdbfffb9c61220 Signed-off-by: Stephen Finucane <[email protected]>
1 parent ff88f4d commit 137ec3f

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
[tool.mypy]
2+
python_version = "3.9"
3+
show_column_numbers = true
4+
show_error_context = true
5+
ignore_missing_imports = true
6+
follow_imports = "normal"
7+
incremental = true
8+
check_untyped_defs = true
9+
warn_unused_ignores = false
10+
# keep this in-sync with 'mypy.exclude' in '.pre-commit-config.yaml'
11+
exclude = '''
12+
(?x)(
13+
doc
14+
| examples
15+
| releasenotes
16+
)
17+
'''
18+
19+
[[tool.mypy.overrides]]
20+
module = ["openstack.tests.unit.*"]
21+
ignore_errors = true
22+
123
[tool.ruff]
224
line-length = 79
325

setup.cfg

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,23 +28,3 @@ packages =
2828
[entry_points]
2929
console_scripts =
3030
openstack-inventory = openstack.cloud.cmd.inventory:main
31-
32-
[mypy]
33-
python_version = 3.9
34-
show_column_numbers = true
35-
show_error_context = true
36-
ignore_missing_imports = true
37-
# follow_imports = normal
38-
follow_imports = skip
39-
incremental = true
40-
check_untyped_defs = true
41-
warn_unused_ignores = false
42-
# keep this in-sync with 'mypy.exclude' in '.pre-commit-config.yaml'
43-
exclude = (?x)(
44-
doc
45-
| examples
46-
| releasenotes
47-
)
48-
49-
[mypy-openstack.tests.unit.*]
50-
ignore_errors = true

0 commit comments

Comments
 (0)