From 6cb2201c1e173d76cb216efd28cafe51bfe5bac2 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 5 Jul 2026 13:54:20 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- docker/unsloth_ipython_startup.py | 1 - docker/unsloth_pip_shim.py | 10 ++++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/docker/unsloth_ipython_startup.py b/docker/unsloth_ipython_startup.py index accb8be781..01f47cf592 100644 --- a/docker/unsloth_ipython_startup.py +++ b/docker/unsloth_ipython_startup.py @@ -27,7 +27,6 @@ try: _kid = "" try: from ipykernel import get_connection_file # type: ignore - _kid = os.path.splitext(os.path.basename(get_connection_file()))[0] except Exception: _kid = "" diff --git a/docker/unsloth_pip_shim.py b/docker/unsloth_pip_shim.py index 927c8bc791..b78aac7c62 100644 --- a/docker/unsloth_pip_shim.py +++ b/docker/unsloth_pip_shim.py @@ -130,11 +130,11 @@ def _parse_include(stripped): for flag in ("-r", "--requirement", "-c", "--constraint"): target = None if body == flag or body.startswith(flag + " "): - target = body[len(flag):].strip() + target = body[len(flag) :].strip() elif body.startswith(flag + "="): - target = body[len(flag) + 1:].strip() + target = body[len(flag) + 1 :].strip() elif not flag.startswith("--") and body.startswith(flag) and len(body) > len(flag): - target = body[len(flag):].strip() # attached short form, e.g. `-rextras.txt` + target = body[len(flag) :].strip() # attached short form, e.g. `-rextras.txt` else: continue return flag, (target or None), comment @@ -208,9 +208,7 @@ def _filter_requirements_file(path, _depth = 0): # Option or nested include. Recursively filter a nested `-r`/`-c` # include (so protected specs deep in the include tree cannot slip # past _KEEP) and repoint it so it still resolves from /tmp. - new_line, rewrote, inc_rec, inc_drp = _rewrite_include( - line, stripped, src_dir, _depth - ) + new_line, rewrote, inc_rec, inc_drp = _rewrite_include(line, stripped, src_dir, _depth) out.append(new_line) if rewrote: changed = True