Skip to content

Commit 0983b71

Browse files
authored
Update ruff and typings (#1365)
1 parent ea6ceee commit 0983b71

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+207
-272
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ repos:
3333
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
3434

3535
- repo: https://github.com/pre-commit/mirrors-prettier
36-
rev: "v3.0.3"
36+
rev: "v3.1.0"
3737
hooks:
3838
- id: prettier
3939
types_or: [yaml, html, json]
@@ -58,7 +58,7 @@ repos:
5858
- id: rst-inline-touching-normal
5959

6060
- repo: https://github.com/pre-commit/mirrors-mypy
61-
rev: "v1.6.1"
61+
rev: "v1.7.0"
6262
hooks:
6363
- id: mypy
6464
files: jupyter_server
@@ -67,7 +67,7 @@ repos:
6767
["traitlets>=5.13", "jupyter_core>=5.5", "jupyter_client>=8.5"]
6868

6969
- repo: https://github.com/astral-sh/ruff-pre-commit
70-
rev: v0.1.5
70+
rev: v0.1.6
7171
hooks:
7272
- id: ruff
7373
types_or: [python, jupyter]
@@ -76,7 +76,7 @@ repos:
7676
types_or: [python, jupyter]
7777

7878
- repo: https://github.com/scientific-python/cookie
79-
rev: "2023.10.27"
79+
rev: "2023.11.17"
8080
hooks:
8181
- id: sp-repo-review
8282
additional_dependencies: ["repo-review[cli]"]

docs/source/conf.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/usr/bin/env python3
2-
#
31
# Jupyter Server documentation build configuration file, created by
42
# sphinx-quickstart on Mon Apr 13 09:51:11 2015.
53
#
@@ -44,7 +42,7 @@
4442
]
4543

4644
try:
47-
import enchant # type:ignore[import-not-found] # noqa
45+
import enchant # type:ignore[import-not-found]
4846

4947
extensions += ["sphinxcontrib.spelling"]
5048
except ImportError:
@@ -338,7 +336,7 @@
338336
spelling_word_list_filename = "spelling_wordlist.txt"
339337

340338
# import before any doc is built, so _ is guaranteed to be injected
341-
import jupyter_server.transutils # noqa: F401
339+
import jupyter_server.transutils
342340

343341
CONFIG_HEADER = """\
344342
.. _other-full-config:

examples/simple/simple_ext1/application.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class SimpleApp1(ExtensionAppJinjaMixin, ExtensionApp):
3636
# Local path to templates directory.
3737
template_paths = [DEFAULT_TEMPLATE_FILES_PATH] # type:ignore[assignment]
3838

39-
configA = Unicode("", config=True, help="Config A example.") # noqa
39+
configA = Unicode("", config=True, help="Config A example.")
4040

41-
configB = Unicode("", config=True, help="Config B example.") # noqa
41+
configB = Unicode("", config=True, help="Config B example.")
4242

43-
configC = Unicode("", config=True, help="Config C example.") # noqa
43+
configC = Unicode("", config=True, help="Config C example.")
4444

4545
def initialize_handlers(self):
4646
"""Initialize handlers."""

examples/simple/simple_ext1/handlers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ def get(self, matched_part=None, *args, **kwargs):
4747
class BaseTemplateHandler(ExtensionHandlerJinjaMixin, ExtensionHandlerMixin, JupyterHandler):
4848
"""The base template handler."""
4949

50-
pass
51-
5250

5351
class TypescriptHandler(BaseTemplateHandler):
5452
"""A typescript handler."""

examples/simple/simple_ext2/application.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SimpleApp2(ExtensionAppJinjaMixin, ExtensionApp):
2929
# Local path to templates directory.
3030
template_paths = [DEFAULT_TEMPLATE_FILES_PATH] # type:ignore[assignment]
3131

32-
configD = Unicode("", config=True, help="Config D example.") # noqa
32+
configD = Unicode("", config=True, help="Config D example.")
3333

3434
def initialize_handlers(self):
3535
"""Initialize handlers."""

examples/simple/simple_ext2/handlers.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ def get(self, matched_part=None, *args, **kwargs):
2020
class BaseTemplateHandler(ExtensionHandlerJinjaMixin, ExtensionHandlerMixin, JupyterHandler):
2121
"""A base template handler."""
2222

23-
pass
24-
2523

2624
class IndexHandler(BaseTemplateHandler):
2725
"""The root API handler."""

examples/simple/tests/test_handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import pytest
33

44

5-
@pytest.fixture
5+
@pytest.fixture()
66
def jp_server_auth_resources(jp_server_auth_core_resources):
77
"""The server auth resources."""
88
for url_regex in [
@@ -12,7 +12,7 @@ def jp_server_auth_resources(jp_server_auth_core_resources):
1212
return jp_server_auth_core_resources
1313

1414

15-
@pytest.fixture
15+
@pytest.fixture()
1616
def jp_server_config(jp_template_dir, jp_server_authorizer):
1717
"""The server config."""
1818
return {

jupyter_server/_sysinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def pkg_commit_hash(pkg_path):
4141
if p.exists(p.join(cur_path, ".git")):
4242
try:
4343
proc = subprocess.Popen(
44-
["git", "rev-parse", "--short", "HEAD"], # noqa
44+
["git", "rev-parse", "--short", "HEAD"],
4545
stdout=subprocess.PIPE,
4646
stderr=subprocess.PIPE,
4747
cwd=pkg_path,

jupyter_server/_tz.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
ZERO = timedelta(0)
1414

1515

16-
class tzUTC(tzinfo): # noqa: N801
16+
class tzUTC(tzinfo):
1717
"""tzinfo object for UTC (zero offset)"""
1818

1919
def utcoffset(self, d: datetime | None) -> timedelta:

jupyter_server/auth/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .authorizer import * # noqa: F403
2-
from .decorator import authorized # noqa: F401
3-
from .identity import * # noqa: F403
4-
from .security import passwd # noqa: F401
1+
from .authorizer import *
2+
from .decorator import authorized
3+
from .identity import *
4+
from .security import passwd

0 commit comments

Comments
 (0)