Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#1104)Co-authored-by: pre-comm…
Browse files Browse the repository at this point in the history
…it-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester <steven.silvester@ieee.org>

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/charliermarsh/ruff-pre-commit: v0.0.243 → v0.0.254](astral-sh/ruff-pre-commit@v0.0.243...v0.0.254)

* sync deps and lint

* lint

* lint

* lint

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
  • Loading branch information
pre-commit-ci[bot] and blink1073 committed Mar 7, 2023
1 parent ba3c113 commit a895ce7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ repos:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.243
rev: v0.0.254
hooks:
- id: ruff
args: ["--fix"]
2 changes: 1 addition & 1 deletion ipykernel/ipkernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _create_comm(*args, **kwargs):

def _get_comm_manager(*args, **kwargs):
"""Create a new CommManager."""
global _comm_manager
global _comm_manager # noqa
if _comm_manager is None:
with _comm_lock:
if _comm_manager is None:
Expand Down
4 changes: 2 additions & 2 deletions ipykernel/kernelapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ def init_blackhole(self):
if self.no_stdout or self.no_stderr:
blackhole = open(os.devnull, "w") # noqa
if self.no_stdout:
sys.stdout = sys.__stdout__ = blackhole
sys.stdout = sys.__stdout__ = blackhole # type:ignore
if self.no_stderr:
sys.stderr = sys.__stderr__ = blackhole
sys.stderr = sys.__stderr__ = blackhole # type:ignore

def init_io(self):
"""Redirect input streams and set a display hook."""
Expand Down
8 changes: 4 additions & 4 deletions ipykernel/pickleutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def use_dill():
# dill doesn't work with cPickle,
# tell the two relevant modules to use plain pickle

global pickle
global pickle # noqa
pickle = dill

try:
Expand All @@ -98,7 +98,7 @@ def use_cloudpickle():
"""
import cloudpickle

global pickle
global pickle # noqa
pickle = cloudpickle

try:
Expand Down Expand Up @@ -278,9 +278,9 @@ def __init__(self, obj):
self.shape = obj.shape
self.dtype = obj.dtype.descr if obj.dtype.fields else obj.dtype.str
self.pickled = False
if sum(obj.shape) == 0:
if sum(obj.shape) == 0: # noqa
self.pickled = True
elif obj.dtype == "O":
elif obj.dtype == "O": # noqa
# can't handle object dtype with buffer approach
self.pickled = True
elif obj.dtype.fields and any(dt == "O" for dt, sz in obj.dtype.fields.values()):
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,7 @@ dependencies = ["mypy>=0.990"]
test = "mypy --install-types --non-interactive {args:.}"

[tool.hatch.envs.lint]
dependencies = ["black==23.1.0", "mdformat>0.7", "ruff==0.0.243"]
dependencies = ["black==23.1.0", "mdformat>0.7", "ruff==0.0.254"]
detached = true
[tool.hatch.envs.lint.scripts]
style = [
Expand Down Expand Up @@ -294,7 +294,9 @@ unfixable = [
# F841 Local variable `t` is assigned to but never used
# EM101 Exception must not use a string literal, assign to variable first
# PLR2004 Magic value used in comparison
"ipykernel/tests/*" = ["B011", "F841", "C408", "E402", "T201", "B007", "N802", "F841", "EM101", "EM102", "EM103", "PLR2004"]
# PLW0603 Using the global statement to update ...
# PLW2901 `for` loop variable ...
"ipykernel/tests/*" = ["B011", "F841", "C408", "E402", "T201", "B007", "N802", "F841", "EM101", "EM102", "EM103", "PLR2004", "PLW0603", "PLW2901"]

[tool.interrogate]
ignore-init-module=true
Expand Down

0 comments on commit a895ce7

Please sign in to comment.