From 9fbaea64ef5903afe872ec752f31ca16379d2ebc Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 19 Oct 2023 21:17:15 -0500 Subject: [PATCH] update ruff and typing --- .pre-commit-config.yaml | 2 +- docs/conf.py | 2 +- pyproject.toml | 4 ++-- pytest_jupyter/jupyter_server.py | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7bd364d..be2de9c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -61,7 +61,7 @@ repos: - id: rst-inline-touching-normal - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.292 + rev: v0.1.1 hooks: - id: ruff args: ["--fix", "--show-fixes"] diff --git a/docs/conf.py b/docs/conf.py index c060e4f..10fe211 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,7 +33,7 @@ ] try: - import enchant # type:ignore[import] # noqa + import enchant # type:ignore[import-not-found] # noqa extensions += ["sphinxcontrib.spelling"] except ImportError: diff --git a/pyproject.toml b/pyproject.toml index 2071fd5..8d765fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,7 +91,7 @@ nowarn = "test -W default {args}" [tool.hatch.envs.typing] features = ["test", "server", "client"] -dependencies = ["mypy>=1.5.1"] +dependencies = ["mypy>=1.6.0", "jupyter_server>=2.8"] [tool.hatch.envs.typing.scripts] test = "mypy --install-types --non-interactive {args:.}" @@ -99,7 +99,7 @@ test = "mypy --install-types --non-interactive {args:.}" dependencies = [ "black[jupyter]==23.3.0", "mdformat>0.7", - "ruff==0.0.276", + "ruff==0.1.1", ] detached = true [tool.hatch.envs.lint.scripts] diff --git a/pytest_jupyter/jupyter_server.py b/pytest_jupyter/jupyter_server.py index eca6043..dc7380d 100644 --- a/pytest_jupyter/jupyter_server.py +++ b/pytest_jupyter/jupyter_server.py @@ -307,8 +307,8 @@ def client_fetch(*parts, headers=None, params=None, **kwargs): if not params: params = {} # Handle URL strings - path_url = url_escape(url_path_join(*parts), plus=False) # type:ignore[no-untyped-call] - base_path_url = url_path_join(jp_base_url, path_url) # type:ignore[no-untyped-call] + path_url = url_escape(url_path_join(*parts), plus=False) + base_path_url = url_path_join(jp_base_url, path_url) params_url = urllib.parse.urlencode(params) url = base_path_url + "?" + params_url # Add auth keys to header, if not overridden @@ -346,8 +346,8 @@ def client_fetch(*parts, headers=None, params=None, **kwargs): if not params: params = {} # Handle URL strings - path_url = url_escape(url_path_join(*parts), plus=False) # type:ignore[no-untyped-call] - base_path_url = url_path_join(jp_base_url, path_url) # type:ignore[no-untyped-call] + path_url = url_escape(url_path_join(*parts), plus=False) + base_path_url = url_path_join(jp_base_url, path_url) urlparts = urllib.parse.urlparse(f"ws://localhost:{jp_http_port}") urlparts = urlparts._replace(path=base_path_url, query=urllib.parse.urlencode(params)) url = urlparts.geturl() @@ -389,7 +389,7 @@ def jp_server_cleanup(jp_asyncio_loop): yield app: ServerApp = ServerApp.instance() # type:ignore[no-untyped-call] try: - jp_asyncio_loop.run_until_complete(app._cleanup()) # type:ignore[no-untyped-call] + jp_asyncio_loop.run_until_complete(app._cleanup()) except (RuntimeError, SystemExit) as e: print("ignoring cleanup error", e) # noqa if hasattr(app, "kernel_manager"):