Skip to content

Commit

Permalink
update ruff and typing
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Oct 20, 2023
1 parent 90429b0 commit 9fbaea6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
]

try:
import enchant # type:ignore[import] # noqa
import enchant # type:ignore[import-not-found] # noqa

extensions += ["sphinxcontrib.spelling"]
except ImportError:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ 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:.}"

[tool.hatch.envs.lint]
dependencies = [
"black[jupyter]==23.3.0",
"mdformat>0.7",
"ruff==0.0.276",
"ruff==0.1.1",
]
detached = true
[tool.hatch.envs.lint.scripts]
Expand Down
10 changes: 5 additions & 5 deletions pytest_jupyter/jupyter_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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"):
Expand Down

0 comments on commit 9fbaea6

Please sign in to comment.