Skip to content

Do not treat an unreachable Hub as a missing model in 16bit merges #1790

Do not treat an unreachable Hub as a missing model in 16bit merges

Do not treat an unreachable Hub as a missing model in 16bit merges #1790

Workflow file for this run

# SPDX-License-Identifier: LGPL-3.0-or-later
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved.
# Whole-repo Python source-lint gate. Adapted from unsloth's lint-ci.yml:
# Python (compileall + narrow ruff) + YAML/JSON round-trip. Dropped vs unsloth:
# shell lint (zoo has no committed *.sh), TypeScript/Rust (Unsloth/Tauri are unsloth-side).
name: Lint CI
on:
pull_request:
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
source-lint:
name: Source lint (Python + YAML + JSON)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Harden runner (audit)
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.12'
cache: 'pip'
- run: pip install 'ruff==0.15.12' 'pyyaml>=6'
- name: Python AST/syntax check (every committed .py must compile)
# continue-on-error during CI bootstrap: pyproject.toml declares
# `requires-python = ">=3.9,<3.15"` but temporary_patches/gpt_oss.py
# uses a 3.10+ `match` statement. Tracked as a separate cleanup PR.
continue-on-error: true
run: |
python -m compileall -q -j 0 unsloth_zoo tests scripts
- name: Python ruff check (narrow gate)
# E9 / F63 / F7 / F82: syntax errors, broken comparisons, undefined names.
# continue-on-error during CI bootstrap: first run on main surfaced 13
# latent findings (rl_replacements.py L1128 F821, gpt_oss match-on-3.9).
continue-on-error: true
run: |
ruff check --select E9,F63,F7,F82 unsloth_zoo tests scripts
- name: No leftover debugger / pdb / breakpoint calls
# Catches `import pdb`, `pdb.set_trace()`, `breakpoint()`, `import ipdb`.
# continue-on-error during bootstrap: rl_replacements.py has a
# `#breakpoint()` comment the regex matches (# is [^A-Za-z_]).
continue-on-error: true
run: |
set -e
if grep -rnE '(^|[^A-Za-z_])(pdb\.set_trace|breakpoint)\(|^import (pdb|ipdb)$|^from (pdb|ipdb) import' \
--include='*.py' unsloth_zoo scripts; then
echo "::error::Leftover debugger call found above. Remove it." >&2
exit 1
fi
- name: YAML round-trip for every committed YAML
run: |
python <<'PY'
import pathlib, sys, yaml
fails = []
for p in pathlib.Path(".").rglob("*.yml"):
if any(part.startswith(".") and part not in (".github",) for part in p.parts):
continue
try:
yaml.safe_load(p.read_text())
except Exception as exc:
fails.append(f"{p}: {exc}")
for p in pathlib.Path(".").rglob("*.yaml"):
if any(part.startswith(".") and part not in (".github",) for part in p.parts):
continue
try:
yaml.safe_load(p.read_text())
except Exception as exc:
fails.append(f"{p}: {exc}")
if fails:
for f in fails:
print("::error::", f)
sys.exit(1)
print(f"YAML round-trip OK")
PY
- name: JSON round-trip for every committed JSON
run: |
python <<'PY'
import pathlib, json, sys
fails = []
for p in pathlib.Path(".").rglob("*.json"):
if any(part in (".git", "node_modules", "__pycache__", "build", "dist") for part in p.parts):
continue
try:
json.loads(p.read_text())
except Exception as exc:
fails.append(f"{p}: {exc}")
if fails:
for f in fails:
print("::error::", f)
sys.exit(1)
print("JSON round-trip OK")
PY
- name: enforce kwargs spacing
# Style rule mirrored from unsloth: kwargs use `name = value` not `name=value`.
continue-on-error: true
run: |
python3 scripts/enforce_kwargs_spacing.py unsloth_zoo