Skip to content

Commit

Permalink
Clean up ruff config (jupyter-server#1358)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Nov 9, 2023
1 parent f282873 commit 9579862
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ repos:
["traitlets>=5.13", "jupyter_core>=5.5", "jupyter_client>=8.5"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.4
rev: v0.1.5
hooks:
- id: ruff
types_or: [python, jupyter]
args: ["--fix", "--show-fixes"]
- id: ruff-format
types_or: [python, jupyter]

- repo: https://github.com/scientific-python/cookie
rev: "2023.10.27"
Expand Down
6 changes: 4 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ integration = "test --integration_tests=true {args}"
detached = true
dependencies = ["pre-commit"]
[tool.hatch.envs.lint.scripts]
build = "pre-commit run --all-files ruff"
build = [
"pre-commit run --all-files ruff",
"pre-commit run --all-files ruff-format",
]

[tool.hatch.version]
path = "jupyter_server/_version.py"
Expand All @@ -137,7 +140,6 @@ install-pre-commit-hook = true
optional-editable-build = true

[tool.ruff]
target-version = "py38"
line-length = 100

[tool.ruff.lint]
Expand Down
2 changes: 2 additions & 0 deletions tests/services/kernels/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import jupyter_client
import pytest
import tornado
from flaky import flaky
from jupyter_client.kernelspec import NATIVE_KERNEL_NAME
from tornado.httpclient import HTTPClientError

Expand Down Expand Up @@ -256,6 +257,7 @@ async def test_kernel_handler_startup_error_pending(
await jp_ws_fetch("api", "kernels", kid, "channels")


@flaky
@pytest.mark.timeout(TEST_TIMEOUT)
async def test_connection(jp_fetch, jp_ws_fetch, jp_http_port, jp_auth_header):
# Create kernel
Expand Down
2 changes: 2 additions & 0 deletions tests/services/sessions/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import jupyter_client
import pytest
import tornado
from flaky import flaky
from jupyter_client.ioloop import AsyncIOLoopKernelManager
from nbformat import writes
from nbformat.v4 import new_notebook
Expand Down Expand Up @@ -506,6 +507,7 @@ async def test_modify_kernel_id(session_client, jp_fetch, jp_serverapp, session_
assert kernel_list == [kernel]


@flaky
@pytest.mark.timeout(TEST_TIMEOUT)
async def test_restart_kernel(session_client, jp_base_url, jp_fetch, jp_ws_fetch, session_is_ready):
# Create a session.
Expand Down

0 comments on commit 9579862

Please sign in to comment.