Skip to content

Commit ebf0a83

Browse files
Maintenance cleanup (#50)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent b68c0f0 commit ebf0a83

File tree

11 files changed

+45
-42
lines changed

11 files changed

+45
-42
lines changed

.github/workflows/check-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717
run: |
1818
pip install -e .
1919
- name: Check Release
20-
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
20+
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2
2121
with:
2222
token: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,16 @@ repos:
2828
files: \.py$
2929
args: [--profile=black]
3030

31-
- repo: https://github.com/pre-commit/mirrors-prettier
32-
rev: v3.0.0-alpha.1
31+
- repo: https://github.com/abravalheri/validate-pyproject
32+
rev: v0.10.1
3333
hooks:
34-
- id: prettier
34+
- id: validate-pyproject
35+
stages: [manual]
36+
37+
- repo: https://github.com/executablebooks/mdformat
38+
rev: 0.7.16
39+
hooks:
40+
- id: mdformat
3541

3642
- repo: https://github.com/asottile/pyupgrade
3743
rev: v3.0.0
@@ -60,7 +66,7 @@ repos:
6066
- id: mypy
6167
exclude: jupyter_client/tests
6268
args: ["--config-file", "pyproject.toml"]
63-
additional_dependencies: [tornado, pytest]
69+
additional_dependencies: [tornado, pytest, traitlets, jupyter_server, terminado]
6470
stages: [manual]
6571

6672
- repo: https://github.com/sirosen/check-jsonschema

CHANGELOG.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ All notable changes to this project will be documented in this file.
1414

1515
### Maintenance and upkeep improvements
1616

17-
- [pre-commit.ci] pre-commit autoupdate [#41](https://github.com/jupyter-server/jupyter_server_terminals/pull/41) ([@pre-commit-ci](https://github.com/pre-commit-ci))
18-
- [pre-commit.ci] pre-commit autoupdate [#40](https://github.com/jupyter-server/jupyter_server_terminals/pull/40) ([@pre-commit-ci](https://github.com/pre-commit-ci))
19-
- [pre-commit.ci] pre-commit autoupdate [#39](https://github.com/jupyter-server/jupyter_server_terminals/pull/39) ([@pre-commit-ci](https://github.com/pre-commit-ci))
17+
- \[pre-commit.ci\] pre-commit autoupdate [#41](https://github.com/jupyter-server/jupyter_server_terminals/pull/41) ([@pre-commit-ci](https://github.com/pre-commit-ci))
18+
- \[pre-commit.ci\] pre-commit autoupdate [#40](https://github.com/jupyter-server/jupyter_server_terminals/pull/40) ([@pre-commit-ci](https://github.com/pre-commit-ci))
19+
- \[pre-commit.ci\] pre-commit autoupdate [#39](https://github.com/jupyter-server/jupyter_server_terminals/pull/39) ([@pre-commit-ci](https://github.com/pre-commit-ci))
2020
- Fix flake8 v5 compat [#38](https://github.com/jupyter-server/jupyter_server_terminals/pull/38) ([@blink1073](https://github.com/blink1073))
21-
- [pre-commit.ci] pre-commit autoupdate [#37](https://github.com/jupyter-server/jupyter_server_terminals/pull/37) ([@pre-commit-ci](https://github.com/pre-commit-ci))
22-
- [pre-commit.ci] pre-commit autoupdate [#36](https://github.com/jupyter-server/jupyter_server_terminals/pull/36) ([@pre-commit-ci](https://github.com/pre-commit-ci))
23-
- [pre-commit.ci] pre-commit autoupdate [#35](https://github.com/jupyter-server/jupyter_server_terminals/pull/35) ([@pre-commit-ci](https://github.com/pre-commit-ci))
24-
- [pre-commit.ci] pre-commit autoupdate [#34](https://github.com/jupyter-server/jupyter_server_terminals/pull/34) ([@pre-commit-ci](https://github.com/pre-commit-ci))
21+
- \[pre-commit.ci\] pre-commit autoupdate [#37](https://github.com/jupyter-server/jupyter_server_terminals/pull/37) ([@pre-commit-ci](https://github.com/pre-commit-ci))
22+
- \[pre-commit.ci\] pre-commit autoupdate [#36](https://github.com/jupyter-server/jupyter_server_terminals/pull/36) ([@pre-commit-ci](https://github.com/pre-commit-ci))
23+
- \[pre-commit.ci\] pre-commit autoupdate [#35](https://github.com/jupyter-server/jupyter_server_terminals/pull/35) ([@pre-commit-ci](https://github.com/pre-commit-ci))
24+
- \[pre-commit.ci\] pre-commit autoupdate [#34](https://github.com/jupyter-server/jupyter_server_terminals/pull/34) ([@pre-commit-ci](https://github.com/pre-commit-ci))
2525
- Suppress tornado 6.2 beta warnings [#33](https://github.com/jupyter-server/jupyter_server_terminals/pull/33) ([@blink1073](https://github.com/blink1073))
26-
- [pre-commit.ci] pre-commit autoupdate [#32](https://github.com/jupyter-server/jupyter_server_terminals/pull/32) ([@pre-commit-ci](https://github.com/pre-commit-ci))
27-
- [pre-commit.ci] pre-commit autoupdate [#31](https://github.com/jupyter-server/jupyter_server_terminals/pull/31) ([@pre-commit-ci](https://github.com/pre-commit-ci))
28-
- [pre-commit.ci] pre-commit autoupdate [#30](https://github.com/jupyter-server/jupyter_server_terminals/pull/30) ([@pre-commit-ci](https://github.com/pre-commit-ci))
26+
- \[pre-commit.ci\] pre-commit autoupdate [#32](https://github.com/jupyter-server/jupyter_server_terminals/pull/32) ([@pre-commit-ci](https://github.com/pre-commit-ci))
27+
- \[pre-commit.ci\] pre-commit autoupdate [#31](https://github.com/jupyter-server/jupyter_server_terminals/pull/31) ([@pre-commit-ci](https://github.com/pre-commit-ci))
28+
- \[pre-commit.ci\] pre-commit autoupdate [#30](https://github.com/jupyter-server/jupyter_server_terminals/pull/30) ([@pre-commit-ci](https://github.com/pre-commit-ci))
2929
- Use hatch backend [#29](https://github.com/jupyter-server/jupyter_server_terminals/pull/29) ([@blink1073](https://github.com/blink1073))
30-
- [pre-commit.ci] pre-commit autoupdate [#28](https://github.com/jupyter-server/jupyter_server_terminals/pull/28) ([@pre-commit-ci](https://github.com/pre-commit-ci))
31-
- [pre-commit.ci] pre-commit autoupdate [#27](https://github.com/jupyter-server/jupyter_server_terminals/pull/27) ([@pre-commit-ci](https://github.com/pre-commit-ci))
30+
- \[pre-commit.ci\] pre-commit autoupdate [#28](https://github.com/jupyter-server/jupyter_server_terminals/pull/28) ([@pre-commit-ci](https://github.com/pre-commit-ci))
31+
- \[pre-commit.ci\] pre-commit autoupdate [#27](https://github.com/jupyter-server/jupyter_server_terminals/pull/27) ([@pre-commit-ci](https://github.com/pre-commit-ci))
3232

3333
### Contributors to this release
3434

@@ -47,12 +47,12 @@ All notable changes to this project will be documented in this file.
4747
- Use alpha release of server 2.0 [#25](https://github.com/jupyter-server/jupyter_server_terminals/pull/25) ([@blink1073](https://github.com/blink1073))
4848
- Switch to flit build backend [#24](https://github.com/jupyter-server/jupyter_server_terminals/pull/24) ([@blink1073](https://github.com/blink1073))
4949
- Allow bot PRs to be auto-labeled [#23](https://github.com/jupyter-server/jupyter_server_terminals/pull/23) ([@blink1073](https://github.com/blink1073))
50-
- [pre-commit.ci] pre-commit autoupdate [#22](https://github.com/jupyter-server/jupyter_server_terminals/pull/22) ([@pre-commit-ci](https://github.com/pre-commit-ci))
51-
- [pre-commit.ci] pre-commit autoupdate [#21](https://github.com/jupyter-server/jupyter_server_terminals/pull/21) ([@pre-commit-ci](https://github.com/pre-commit-ci))
50+
- \[pre-commit.ci\] pre-commit autoupdate [#22](https://github.com/jupyter-server/jupyter_server_terminals/pull/22) ([@pre-commit-ci](https://github.com/pre-commit-ci))
51+
- \[pre-commit.ci\] pre-commit autoupdate [#21](https://github.com/jupyter-server/jupyter_server_terminals/pull/21) ([@pre-commit-ci](https://github.com/pre-commit-ci))
5252
- Add mypy check [#20](https://github.com/jupyter-server/jupyter_server_terminals/pull/20) ([@blink1073](https://github.com/blink1073))
53-
- [pre-commit.ci] pre-commit autoupdate [#19](https://github.com/jupyter-server/jupyter_server_terminals/pull/19) ([@pre-commit-ci](https://github.com/pre-commit-ci))
53+
- \[pre-commit.ci\] pre-commit autoupdate [#19](https://github.com/jupyter-server/jupyter_server_terminals/pull/19) ([@pre-commit-ci](https://github.com/pre-commit-ci))
5454
- Clean up pre-commit [#18](https://github.com/jupyter-server/jupyter_server_terminals/pull/18) ([@blink1073](https://github.com/blink1073))
55-
- [pre-commit.ci] pre-commit autoupdate [#17](https://github.com/jupyter-server/jupyter_server_terminals/pull/17) ([@pre-commit-ci](https://github.com/pre-commit-ci))
55+
- \[pre-commit.ci\] pre-commit autoupdate [#17](https://github.com/jupyter-server/jupyter_server_terminals/pull/17) ([@pre-commit-ci](https://github.com/pre-commit-ci))
5656

5757
### Contributors to this release
5858

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ Jupyter Server Terminals is a Jupyter Server Extension providing support for ter
99
To install the latest release locally, make sure you have
1010
[pip installed](https://pip.readthedocs.io/en/stable/installing/) and run:
1111

12-
pip install jupyter_server_terminals
12+
```
13+
pip install jupyter_server_terminals
14+
```
1315

1416
Jupyter Server Terminals currently supports Python>=3.6 on Linux, OSX and Windows.
1517

jupyter_server_terminals/api_handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from .base import TerminalsMixin
88

99
try:
10-
from jupyter_server.auth import authorized
10+
from jupyter_server.auth.decorator import authorized
1111
from jupyter_server.base.handlers import APIHandler
1212
except ModuleNotFoundError:
1313
raise ModuleNotFoundError("Jupyter Server must be installed to use this extension.")
@@ -60,7 +60,7 @@ def post(self):
6060

6161

6262
class TerminalHandler(TerminalsMixin, TerminalAPIHandler):
63-
SUPPORTED_METHODS = ("GET", "DELETE")
63+
SUPPORTED_METHODS = ("GET", "DELETE") # type:ignore[assignment]
6464

6565
@web.authenticated
6666
@authorized

jupyter_server_terminals/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
class TerminalsMixin(ExtensionHandlerMixin):
88
@property
99
def terminal_manager(self):
10-
return self.settings["terminal_manager"]
10+
return self.settings["terminal_manager"] # type:ignore[attr-defined]

jupyter_server_terminals/handlers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Tornado handlers for the terminal emulator."""
22
# Copyright (c) Jupyter Development Team.
33
# Distributed under the terms of the Modified BSD License.
4-
import terminado
4+
from terminado.websocket import TermSocket as BaseTermSocket
55
from tornado import web
66

77
from .base import TerminalsMixin
@@ -17,12 +17,12 @@
1717
AUTH_RESOURCE = "terminals"
1818

1919

20-
class TermSocket(TerminalsMixin, WebSocketMixin, JupyterHandler, terminado.TermSocket):
20+
class TermSocket(TerminalsMixin, WebSocketMixin, JupyterHandler, BaseTermSocket):
2121

2222
auth_resource = AUTH_RESOURCE
2323

2424
def initialize(self, name, term_manager, **kwargs):
25-
terminado.TermSocket.initialize(self, term_manager, **kwargs)
25+
BaseTermSocket.initialize(self, term_manager, **kwargs)
2626
TerminalsMixin.initialize(self, name)
2727

2828
def origin_check(self):

jupyter_server_terminals/terminalmanager.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@
66
# Distributed under the terms of the Modified BSD License.
77
from datetime import timedelta
88

9-
import terminado
9+
from terminado.management import NamedTermManager
1010
from tornado import web
1111
from tornado.ioloop import IOLoop, PeriodicCallback
1212
from traitlets import Integer
1313
from traitlets.config import LoggingConfigurable
1414

1515
try:
1616
from jupyter_server._tz import isoformat, utcnow
17-
from jupyter_server.prometheus.metrics import TERMINAL_CURRENTLY_RUNNING_TOTAL
17+
from jupyter_server.prometheus.metrics import ( # type:ignore[attr-defined]
18+
TERMINAL_CURRENTLY_RUNNING_TOTAL,
19+
)
1820
except ModuleNotFoundError:
1921
raise ModuleNotFoundError("Jupyter Server must be installed to use this extension.")
2022

2123

22-
class TerminalManager(LoggingConfigurable, terminado.NamedTermManager):
24+
class TerminalManager(LoggingConfigurable, NamedTermManager): # type:ignore[misc]
2325
""" """
2426

2527
_culler_callback = None

pyproject.toml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ Homepage = "https://jupyter.org"
3939
[project.optional-dependencies]
4040
test = [
4141
"coverage",
42-
"jupyter_server[test]>=2.0.0a0",
43-
"pytest>=6.0",
42+
"jupyter_server[test]>=2.0.0rc0",
43+
"pytest>=7.0",
4444
"pytest_tornasync",
4545
"pytest-cov",
4646
"pytest-timeout",
@@ -86,13 +86,6 @@ warn_redundant_casts = true
8686
warn_return_any = true
8787
warn_unused_ignores = true
8888

89-
[[tool.mypy.overrides]]
90-
module = [
91-
"traitlets.*",
92-
"jupyter_server.*",
93-
"terminado"
94-
]
95-
ignore_missing_imports = true
9689

9790
[tool.jupyter-releaser]
9891
skip = ["check-links"]

tests/test_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from jupyter_server.auth.utils import HTTP_METHOD_TO_AUTH_ACTION, match_url_to_resource
88
from tornado.httpclient import HTTPClientError
99
from tornado.websocket import WebSocketHandler
10-
from traitlets.config import Config
10+
from traitlets.config.loader import Config
1111

1212

1313
class AuthorizerforTesting(Authorizer):

0 commit comments

Comments
 (0)