Skip to content

Commit 12cd342

Browse files
committed
ci: Fix type checking
1 parent 4de7024 commit 12cd342

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

config/mypy.ini

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ ignore_missing_imports = true
33
exclude = tests/fixtures/
44
warn_unused_ignores = true
55
show_error_codes = true
6+
namespace_packages = true
7+
explicit_package_bases = true

duties.py

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ def check_types(ctx): # noqa: WPS231
196196
Arguments:
197197
ctx: The context instance (passed automatically).
198198
"""
199+
os.environ["MYPYPATH"] = "src"
199200
ctx.run(f"mypy --config-file config/mypy.ini {PY_SRC}", title="Type-checking", pty=PTY)
200201

201202

tests/conftest.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,7 @@
77
import pytest
88
from markdown.core import Markdown
99
from mkdocs import config
10-
11-
try:
12-
from mkdocs.config.defaults import get_schema
13-
except ImportError:
14-
15-
def get_schema() -> tuple[tuple]: # noqa: WPS440
16-
"""Fallback for old versions of MkDocs.
17-
18-
Returns:
19-
The default schema.
20-
"""
21-
return config.DEFAULT_SCHEMA
10+
from mkdocs.config.defaults import get_schema
2211

2312

2413
@pytest.fixture(name="mkdocs_conf")

0 commit comments

Comments
 (0)