mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-06-19 07:35:35 +00:00
mypy: Stop ignoring missing imports
This commit is contained in:
@@ -6,7 +6,7 @@ import re
|
||||
import subprocess
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import ghp_import
|
||||
import ghp_import # type: ignore
|
||||
from packaging import version
|
||||
|
||||
import mkdocs
|
||||
|
||||
@@ -13,7 +13,8 @@ from mkdocs.plugins import BasePlugin
|
||||
if TYPE_CHECKING:
|
||||
from mkdocs.config.defaults import MkDocsConfig
|
||||
from mkdocs.structure.pages import Page
|
||||
from mkdocs.util.templates import TemplateContext
|
||||
from mkdocs.utils.templates import TemplateContext
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
base_path = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
@@ -13,7 +13,7 @@ if TYPE_CHECKING:
|
||||
from mkdocs.structure.toc import AnchorLink, TableOfContents
|
||||
|
||||
try:
|
||||
from lunr import lunr
|
||||
from lunr import lunr # type: ignore
|
||||
|
||||
haslunrpy = True
|
||||
except ImportError:
|
||||
|
||||
@@ -17,7 +17,7 @@ try:
|
||||
|
||||
has_babel = True
|
||||
except ImportError: # pragma: no cover
|
||||
from mkdocs.utils.babel_stub import Locale, UnknownLocaleError
|
||||
from mkdocs.utils.babel_stub import Locale, UnknownLocaleError # type: ignore
|
||||
|
||||
has_babel = False
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import unittest
|
||||
from unittest import mock
|
||||
|
||||
from ghp_import import GhpError
|
||||
from ghp_import import GhpError # type: ignore
|
||||
|
||||
from mkdocs import __version__
|
||||
from mkdocs.commands import gh_deploy
|
||||
|
||||
@@ -6,10 +6,10 @@ import os
|
||||
import os.path
|
||||
from typing import IO, TYPE_CHECKING, Any
|
||||
|
||||
import mergedeep
|
||||
import mergedeep # type: ignore
|
||||
import yaml
|
||||
import yaml.constructor
|
||||
import yaml_env_tag
|
||||
import yaml_env_tag # type: ignore
|
||||
|
||||
from mkdocs import exceptions
|
||||
|
||||
|
||||
+1
-1
@@ -150,6 +150,7 @@ matrix.type.features = [
|
||||
[tool.hatch.envs.types]
|
||||
dependencies = [
|
||||
"mypy",
|
||||
"types-babel",
|
||||
"types-Jinja2",
|
||||
"types-Markdown",
|
||||
"types-PyYAML",
|
||||
@@ -235,7 +236,6 @@ ignore = ["E501", "E731"]
|
||||
allow-dict-calls-with-keyword-arguments = true
|
||||
|
||||
[tool.mypy]
|
||||
ignore_missing_imports = true
|
||||
warn_unreachable = true
|
||||
no_implicit_optional = true
|
||||
show_error_codes = true
|
||||
|
||||
Reference in New Issue
Block a user