Skip to content

Commit 9022629

Browse files
committed
mypy: Add no_incremental option
This option avoids using a cache. It is slower but prevents some issues with `mypy` giving different results on different runs (typically complaining about some `type: ignore[issue]` not being used but when removing it complaining about an `issue` again. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent b31a382 commit 9022629

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

noxfile.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
"""Configuration file for nox."""
55

6-
from frequenz.repo.config import RepositoryType, nox
6+
from frequenz.repo.config import nox
7+
from frequenz.repo.config.nox import default
78

8-
nox.configure(RepositoryType.LIB)
9+
config = default.lib_config.copy()
10+
config.opts.mypy = [] # Set in pyproject.toml
11+
12+
nox.configure(config)

pyproject.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ testpaths = ["tests", "src"]
135135
asyncio_mode = "auto"
136136
required_plugins = ["pytest-asyncio", "pytest-mock"]
137137

138+
[tool.mypy]
139+
explicit_package_bases = true
140+
namespace_packages = true
141+
no_incremental = true
142+
packages = ["frequenz.sdk"]
143+
strict = true
144+
138145
[[tool.mypy.overrides]]
139146
module = [
140147
"async_solipsism",

0 commit comments

Comments
 (0)