Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#352)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Steven Silvester <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and blink1073 authored May 6, 2023
1 parent 5e124d2 commit b1086f2
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ repos:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.260
rev: v0.0.263
hooks:
- id: ruff
args: ["--fix"]
Expand Down
5 changes: 4 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
version: 2
python:
version: 3.8
install:
# install itself with pip install .
- method: pip
path: .
extra_requirements:
- docs
build:
os: ubuntu-22.04
tools:
python: "3.11"
2 changes: 1 addition & 1 deletion jupyter_core/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def initialize(self, argv=None):
def start(self):
"""Start the whole thing"""
if self.subcommand:
os.execv(self.subcommand, [self.subcommand] + self.argv[1:])
os.execv(self.subcommand, [self.subcommand] + self.argv[1:]) # noqa
raise NoStart()

if self.subapp:
Expand Down
4 changes: 2 additions & 2 deletions jupyter_core/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _execvp(cmd, argv):
cmd_path = which(cmd)
if cmd_path is None:
raise OSError("%r not found" % cmd, errno.ENOENT)
p = Popen([cmd_path] + argv[1:])
p = Popen([cmd_path] + argv[1:]) # noqa
# Don't raise KeyboardInterrupt in the parent process.
# Set this after spawning, to avoid subprocess inheriting handler.
import signal
Expand All @@ -128,7 +128,7 @@ def _execvp(cmd, argv):
p.wait()
sys.exit(p.returncode)
else:
os.execvp(cmd, argv)
os.execvp(cmd, argv) # noqa


def _jupyter_abspath(subcommand):
Expand Down
6 changes: 3 additions & 3 deletions jupyter_core/tests/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def test_is_hidden_win32_cpython():
subdir1 = os.path.join(root, "subdir")
os.makedirs(subdir1)
assert not is_hidden(subdir1, root)
subprocess.check_call(["attrib", "+h", subdir1])
subprocess.check_call(["attrib", "+h", subdir1]) # noqa
assert is_hidden(subdir1, root)
assert is_file_hidden(subdir1)

Expand All @@ -494,7 +494,7 @@ def test_is_hidden_win32_pypy():
subdir1 = os.path.join(root, "subdir")
os.makedirs(subdir1)
assert not is_hidden(subdir1, root)
subprocess.check_call(["attrib", "+h", subdir1])
subprocess.check_call(["attrib", "+h", subdir1]) # noqa

with warnings.catch_warnings(record=True) as w:
# Cause all warnings to always be triggered.
Expand Down Expand Up @@ -527,7 +527,7 @@ def test_secure_write_win32():
def fetch_win32_permissions(filename):
"""Extracts file permissions on windows using icacls"""
role_permissions = {}
proc = os.popen("icacls %s" % filename)
proc = os.popen("icacls %s" % filename) # noqa
lines = proc.read().splitlines()
proc.close()
for index, line in enumerate(lines):
Expand Down
2 changes: 1 addition & 1 deletion jupyter_core/troubleshoot.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def subs(cmd: Union[List[str], str]) -> Optional[str]:
get data from commands that we need to run outside of python
"""
try:
stdout = subprocess.check_output(cmd)
stdout = subprocess.check_output(cmd) # noqa
return stdout.decode("utf-8", "replace").strip()
except (OSError, subprocess.CalledProcessError):
return None
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ dependencies = ["mypy>=0.990"]
test = "mypy --install-types --non-interactive {args:.}"

[tool.hatch.envs.lint]
dependencies = ["black==23.3.0", "mdformat>0.7", "ruff==0.0.260"]
dependencies = ["black==23.3.0", "mdformat>0.7", "ruff==0.0.263"]
detached = true
[tool.hatch.envs.lint.scripts]
style = [
Expand Down Expand Up @@ -197,7 +197,8 @@ unfixable = [
# S101 Use of `assert` detected
# S108 Probable insecure usage of temporary file or directory: "/tmp"
# PLR2004 Magic value used in comparison, consider replacing b'WITNESS A' with a constant variable
"jupyter_core/tests/*" = ["B011", "F841", "C408", "E402", "T201", "B007", "N802", "S101", "S108", "PLR2004"]
# S603 `subprocess` call: check for execution of untrusted input
"jupyter_core/tests/*" = ["B011", "F841", "C408", "E402", "T201", "B007", "N802", "S101", "S108", "PLR2004", "S603"]
# F821 Undefined name `get_config`
"jupyter_core/tests/**/profile_default/*_config.py" = ["F821"]
# T201 `print` found
Expand Down

0 comments on commit b1086f2

Please sign in to comment.