Skip to content

Commit b9b4290

Browse files
[pre-commit.ci] pre-commit autoupdate (#73)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester <[email protected]>
1 parent 319bcb8 commit b9b4290

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ repos:
3131
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]
3232

3333
- repo: https://github.com/psf/black
34-
rev: 22.10.0
34+
rev: 22.12.0
3535
hooks:
3636
- id: black
3737

3838
- repo: https://github.com/charliermarsh/ruff-pre-commit
39-
rev: v0.0.189
39+
rev: v0.0.206
4040
hooks:
4141
- id: ruff
4242
args: ["--fix"]

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,10 @@ All notable changes to this project will be documented in this file.
198198

199199
### Documentation improvements
200200

201-
- Fix links in readme [#3](https://github.com/jupyter-server/jupyter_server_terminals/pull/3) ([@jweill-aws](https://github.com/jweill-aws))
201+
- Fix links in readme [#3](https://github.com/jupyter-server/jupyter_server_terminals/pull/3) ([@jasonweill](https://github.com/jasonweill))
202202

203203
### Contributors to this release
204204

205205
([GitHub contributors page for this release](https://github.com/jupyter-server/jupyter_server_terminals/graphs/contributors?from=2021-12-26&to=2022-04-02&type=c))
206206

207-
[@blink1073](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Ablink1073+updated%3A2021-12-26..2022-04-02&type=Issues) | [@jweill-aws](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Ajweill-aws+updated%3A2021-12-26..2022-04-02&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Awelcome+updated%3A2021-12-26..2022-04-02&type=Issues) | [@Wh1isper](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3AWh1isper+updated%3A2021-12-26..2022-04-02&type=Issues) | [@Zsailer](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3AZsailer+updated%3A2021-12-26..2022-04-02&type=Issues)
207+
[@blink1073](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Ablink1073+updated%3A2021-12-26..2022-04-02&type=Issues) | [@jasonweills](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Ajasonweill+updated%3A2021-12-26..2022-04-02&type=Issues) | [@welcome](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3Awelcome+updated%3A2021-12-26..2022-04-02&type=Issues) | [@Wh1isper](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3AWh1isper+updated%3A2021-12-26..2022-04-02&type=Issues) | [@Zsailer](https://github.com/search?q=repo%3Ajupyter-server%2Fjupyter_server_terminals+involves%3AZsailer+updated%3A2021-12-26..2022-04-02&type=Issues)

jupyter_server_terminals/terminalmanager.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
from datetime import timedelta
88

99
from jupyter_server._tz import isoformat, utcnow
10-
from jupyter_server.prometheus.metrics import ( # type:ignore[attr-defined]
11-
TERMINAL_CURRENTLY_RUNNING_TOTAL,
12-
)
10+
from jupyter_server.prometheus import metrics
1311
from terminado.management import NamedTermManager
1412
from tornado import web
1513
from tornado.ioloop import IOLoop, PeriodicCallback
1614
from traitlets import Integer
1715
from traitlets.config import LoggingConfigurable
1816

17+
RUNNING_TOTAL = metrics.TERMINAL_CURRENTLY_RUNNING_TOTAL # type:ignore[attr-defined]
18+
1919

2020
class TerminalManager(LoggingConfigurable, NamedTermManager): # type:ignore[misc]
2121
"""A MultiTerminalManager for use in the notebook webserver"""
@@ -50,7 +50,7 @@ def create(self, **kwargs):
5050
term.last_activity = utcnow()
5151
model = self.get_terminal_model(name)
5252
# Increase the metric by one because a new terminal was created
53-
TERMINAL_CURRENTLY_RUNNING_TOTAL.inc()
53+
RUNNING_TOTAL.inc()
5454
# Ensure culler is initialized
5555
self._initialize_culler()
5656
return model
@@ -65,7 +65,7 @@ def list(self):
6565
models = [self.get_terminal_model(name) for name in self.terminals]
6666

6767
# Update the metric below to the length of the list 'terms'
68-
TERMINAL_CURRENTLY_RUNNING_TOTAL.set(len(models))
68+
RUNNING_TOTAL.set(len(models))
6969
return models
7070

7171
async def terminate(self, name, force=False):
@@ -75,7 +75,7 @@ async def terminate(self, name, force=False):
7575

7676
# Decrease the metric below by one
7777
# because a terminal has been shutdown
78-
TERMINAL_CURRENTLY_RUNNING_TOTAL.dec()
78+
RUNNING_TOTAL.dec()
7979

8080
async def terminate_all(self):
8181
"""Terminate all terminals."""

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ test = "mypy --install-types --non-interactive {args:jupyter_server_terminals te
8989

9090
[tool.hatch.envs.lint]
9191
dependencies = [
92-
"black[jupyter]==22.10.0",
92+
"black[jupyter]==22.12.0",
9393
"mdformat>0.7",
9494
"mdformat-gfm>=0.3.5",
95-
"ruff==0.0.189"
95+
"ruff==0.0.206"
9696
]
9797
detached = true
9898
[tool.hatch.envs.lint.scripts]

0 commit comments

Comments
 (0)