diff --git a/docs/source/conf.py b/docs/source/conf.py index 29db736e96..6b301f2523 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -44,7 +44,7 @@ ] try: - import enchant # type:ignore[import] # noqa + import enchant # type:ignore[import-not-found] # noqa extensions += ["sphinxcontrib.spelling"] except ImportError: diff --git a/examples/identity/system_password/jupyter_server_config.py b/examples/identity/system_password/jupyter_server_config.py index 440158bfbc..d23de143b2 100644 --- a/examples/identity/system_password/jupyter_server_config.py +++ b/examples/identity/system_password/jupyter_server_config.py @@ -2,7 +2,7 @@ import pwd from getpass import getuser -from pamela import PAMError, authenticate # type:ignore[import] +from pamela import PAMError, authenticate # type:ignore[import-not-found] from jupyter_server.auth.identity import IdentityProvider, User diff --git a/examples/simple/simple_ext11/application.py b/examples/simple/simple_ext11/application.py index 34f441cf16..398716f213 100644 --- a/examples/simple/simple_ext11/application.py +++ b/examples/simple/simple_ext11/application.py @@ -1,7 +1,7 @@ """A Jupyter Server example application.""" import os -from simple_ext1.application import SimpleApp1 # type:ignore[import] +from simple_ext1.application import SimpleApp1 # type:ignore[import-not-found] from traitlets import Bool, Unicode, observe from jupyter_server.serverapp import aliases, flags diff --git a/jupyter_server/gateway/managers.py b/jupyter_server/gateway/managers.py index eb203d59f4..b3e51e71ce 100644 --- a/jupyter_server/gateway/managers.py +++ b/jupyter_server/gateway/managers.py @@ -11,7 +11,7 @@ from time import monotonic from typing import Any, Dict, Optional -import websocket # type:ignore[import] +import websocket # type:ignore[import-untyped] from jupyter_client.asynchronous.client import AsyncKernelClient from jupyter_client.clientabc import KernelClientABC from jupyter_client.kernelspec import KernelSpecManager diff --git a/jupyter_server/prometheus/metrics.py b/jupyter_server/prometheus/metrics.py index ac90d10578..3a4b113439 100644 --- a/jupyter_server/prometheus/metrics.py +++ b/jupyter_server/prometheus/metrics.py @@ -9,7 +9,7 @@ # Jupyter Notebook also defines these metrics. Re-defining them results in a ValueError. # Try to de-duplicate by using the ones in Notebook if available. # See https://github.com/jupyter/jupyter_server/issues/209 - from notebook.prometheus.metrics import ( # type:ignore[import] + from notebook.prometheus.metrics import ( # type:ignore[import-not-found] HTTP_REQUEST_DURATION_SECONDS, KERNEL_CURRENTLY_RUNNING_TOTAL, TERMINAL_CURRENTLY_RUNNING_TOTAL, diff --git a/jupyter_server/services/sessions/sessionmanager.py b/jupyter_server/services/sessions/sessionmanager.py index d923b8b8bf..ba55cc2836 100644 --- a/jupyter_server/services/sessions/sessionmanager.py +++ b/jupyter_server/services/sessions/sessionmanager.py @@ -14,7 +14,7 @@ import sqlite3 except ImportError: # fallback on pysqlite2 if Python was build without sqlite - from pysqlite2 import dbapi2 as sqlite3 # type:ignore[import,no-redef] + from pysqlite2 import dbapi2 as sqlite3 # type:ignore[import-not-found,no-redef] from dataclasses import dataclass, fields diff --git a/jupyter_server/utils.py b/jupyter_server/utils.py index bd41710275..ac29e95aa5 100644 --- a/jupyter_server/utils.py +++ b/jupyter_server/utils.py @@ -22,7 +22,7 @@ ) from urllib.request import pathname2url # noqa: F401 -from _frozen_importlib_external import _NamespacePath # type:ignore[import] +from _frozen_importlib_external import _NamespacePath # type:ignore[import-not-found] from jupyter_core.utils import ensure_async from packaging.version import Version from tornado.httpclient import AsyncHTTPClient, HTTPClient, HTTPRequest, HTTPResponse diff --git a/pyproject.toml b/pyproject.toml index 75d632c834..cd9d80aacb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,7 +104,7 @@ nowarn = "test -W default {args}" [tool.hatch.envs.typing] features = ["test"] -dependencies = [ "mypy>=1.5.1", "traitlets>=5.11.2", "jupyter_core>=5.3.2"] +dependencies = [ "mypy~=1.6", "traitlets>=5.11.2", "jupyter_core>=5.3.2"] [tool.hatch.envs.typing.scripts] test = "mypy --install-types --non-interactive {args:.}" diff --git a/tests/test_terminal.py b/tests/test_terminal.py index b905b1aba0..5e45b01dee 100644 --- a/tests/test_terminal.py +++ b/tests/test_terminal.py @@ -7,7 +7,7 @@ import warnings import pytest -from flaky import flaky # type:ignore[import] +from flaky import flaky # type:ignore[import-untyped] from tornado.httpclient import HTTPClientError from traitlets.config import Config