Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#273)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/python-jsonschema/check-jsonschema: 0.19.2 → 0.21.0](python-jsonschema/check-jsonschema@0.19.2...0.21.0)
- [github.com/psf/black: 22.12.0 → 23.1.0](psf/black@22.12.0...23.1.0)
- [github.com/charliermarsh/ruff-pre-commit: v0.0.207 → v0.0.254](astral-sh/ruff-pre-commit@v0.0.207...v0.0.254)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Lint

* Update ruff==0.0.254

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: David Brochart <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and davidbrochart authored Mar 7, 2023
1 parent a105ed2 commit 1443d4a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.19.2
rev: 0.21.0
hooks:
- id: check-github-workflows

Expand All @@ -31,12 +31,12 @@ repos:
[mdformat-gfm, mdformat-frontmatter, mdformat-footnote]

- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.1.0
hooks:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.207
rev: v0.0.254
hooks:
- id: ruff
args: ["--fix"]
8 changes: 2 additions & 6 deletions nbclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def timestamp(msg: t.Optional[t.Dict] = None) -> str:
formatted_time
): # docs indicate strftime may return empty string, so let's catch that too
return formatted_time
except Exception:
except Exception: # noqa
pass # fallback to a local time

return datetime.datetime.utcnow().isoformat() + 'Z'
Expand Down Expand Up @@ -616,7 +616,7 @@ async def async_setup_kernel(self, **kwargs: t.Any) -> t.AsyncGenerator:

def on_signal():
"""Handle signals."""
asyncio.ensure_future(self._async_cleanup_kernel())
self._async_cleanup_kernel_future = asyncio.ensure_future(self._async_cleanup_kernel())
atexit.unregister(self._cleanup_kernel)

loop = asyncio.get_event_loop()
Expand Down Expand Up @@ -750,7 +750,6 @@ async def _async_poll_for_reply(
task_poll_output_msg: asyncio.Future,
task_poll_kernel_alive: asyncio.Future,
) -> t.Dict:

msg: t.Dict
assert self.kc is not None
new_timeout: t.Optional[float] = None
Expand Down Expand Up @@ -793,7 +792,6 @@ async def _async_poll_for_reply(
async def _async_poll_output_msg(
self, parent_msg_id: str, cell: NotebookNode, cell_index: int
) -> None:

assert self.kc is not None
while True:
msg = await ensure_async(self.kc.iopub_channel.get_msg(timeout=None))
Expand Down Expand Up @@ -828,7 +826,6 @@ def _get_timeout(self, cell: t.Optional[NotebookNode]) -> t.Optional[int]:
async def _async_handle_timeout(
self, timeout: int, cell: t.Optional[NotebookNode] = None
) -> t.Union[None, t.Dict]:

self.log.error("Timeout waiting for execute reply (%is)." % timeout)
if self.interrupt_on_timeout:
self.log.error("Interrupting kernel")
Expand Down Expand Up @@ -886,7 +883,6 @@ def _passed_deadline(self, deadline: int) -> bool:
async def _check_raise_for_error(
self, cell: NotebookNode, cell_index: int, exec_reply: t.Optional[t.Dict]
) -> None:

if exec_reply is None:
return None

Expand Down
2 changes: 1 addition & 1 deletion nbclient/tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ def stop_channels(self) -> None:
class TestExecute(NBClientTestsBase):
"""Contains test functions for execute.py"""

maxDiff = None # noqa
maxDiff = None

def test_constructor(self):
NotebookClient(nbformat.v4.new_notebook())
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ dependencies = [
"black[jupyter]==22.10.0",
"mdformat>0.7",
"mdformat-gfm>=0.3.5",
"ruff==0.0.189"
"ruff==0.0.254"
]
detached = true
[tool.hatch.envs.lint.scripts]
Expand Down

0 comments on commit 1443d4a

Please sign in to comment.