fix: replace Unicode dashes with ASCII equivalents across codebase
Box-drawing chars (U+2500), em dashes (U+2014), and en dashes (U+2013) in comments, section dividers, log messages, and docstrings are not representable on legacy code pages like CP1252. Replace them with plain ASCII dashes so the codebase is consistently ASCII-safe. User-facing UI strings (placeholders, separators, display text in the frontend) are left unchanged since they render in the browser which handles Unicode natively.
This commit is contained in:
parent
8c94b461fb
commit
a1eff8ee22
61 changed files with 448 additions and 448 deletions
|
|
@ -22,20 +22,20 @@ from pathlib import Path
|
|||
|
||||
IS_WINDOWS = sys.platform == "win32"
|
||||
|
||||
# ── Verbosity control ──────────────────────────────────────────────────────────
|
||||
# -- Verbosity control ----------------------------------------------------------
|
||||
# By default the installer shows a minimal progress bar (one line, in-place).
|
||||
# Set UNSLOTH_VERBOSE=1 in the environment to restore full per-step output:
|
||||
# Linux/Mac: UNSLOTH_VERBOSE=1 ./studio/setup.sh
|
||||
# Windows: $env:UNSLOTH_VERBOSE="1" ; .\studio\setup.ps1
|
||||
VERBOSE: bool = os.environ.get("UNSLOTH_VERBOSE", "0") == "1"
|
||||
|
||||
# Progress bar state — updated by _progress() as each install step runs.
|
||||
# Progress bar state -- updated by _progress() as each install step runs.
|
||||
# _TOTAL counts: pip-upgrade + 7 shared steps + triton (non-Windows) + local-plugin + finalize
|
||||
# Update _TOTAL here if you add or remove install steps in install_python_stack().
|
||||
_STEP: int = 0
|
||||
_TOTAL: int = 0 # set at runtime in install_python_stack() based on platform
|
||||
|
||||
# ── Paths ──────────────────────────────────────────────────────────────
|
||||
# -- Paths --------------------------------------------------------------
|
||||
SCRIPT_DIR = Path(__file__).resolve().parent
|
||||
REQ_ROOT = SCRIPT_DIR / "backend" / "requirements"
|
||||
SINGLE_ENV = REQ_ROOT / "single-env"
|
||||
|
|
@ -44,7 +44,7 @@ LOCAL_DD_UNSTRUCTURED_PLUGIN = (
|
|||
SCRIPT_DIR / "backend" / "plugins" / "data-designer-unstructured-seed"
|
||||
)
|
||||
|
||||
# ── Color support ──────────────────────────────────────────────────────
|
||||
# -- Color support ------------------------------------------------------
|
||||
|
||||
|
||||
def _enable_colors() -> bool:
|
||||
|
|
@ -72,7 +72,7 @@ def _enable_colors() -> bool:
|
|||
return True # Unix terminals support ANSI by default
|
||||
|
||||
|
||||
# Colors disabled — Colab and most CI runners render ANSI fine, but plain output
|
||||
# Colors disabled -- Colab and most CI runners render ANSI fine, but plain output
|
||||
# is cleaner in the notebook cell. Re-enable by setting _HAS_COLOR = _enable_colors()
|
||||
_HAS_COLOR = False
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ def _red(msg: str) -> str:
|
|||
def _progress(label: str) -> None:
|
||||
"""Print an in-place progress bar for the current install step.
|
||||
|
||||
Uses only stdlib (sys.stdout) — no extra packages required.
|
||||
Uses only stdlib (sys.stdout) -- no extra packages required.
|
||||
In VERBOSE mode this is a no-op; per-step labels are printed by run() instead.
|
||||
"""
|
||||
global _STEP
|
||||
|
|
@ -129,7 +129,7 @@ def run(
|
|||
# Packages to skip on Windows (require special build steps)
|
||||
WINDOWS_SKIP_PACKAGES = {"open_spiel", "triton_kernels"}
|
||||
|
||||
# ── uv bootstrap ──────────────────────────────────────────────────────
|
||||
# -- uv bootstrap ------------------------------------------------------
|
||||
|
||||
USE_UV = False # Set by _bootstrap_uv() at the start of install_python_stack()
|
||||
UV_NEEDS_SYSTEM = False # Set by _bootstrap_uv() via probe
|
||||
|
|
@ -285,7 +285,7 @@ def patch_package_file(package_name: str, relative_path: str, url: str) -> None:
|
|||
download_file(url, dest)
|
||||
|
||||
|
||||
# ── Main install sequence ─────────────────────────────────────────────
|
||||
# -- Main install sequence ---------------------------------------------
|
||||
|
||||
|
||||
def install_python_stack() -> int:
|
||||
|
|
@ -316,7 +316,7 @@ def install_python_stack() -> int:
|
|||
req = REQ_ROOT / "extras.txt",
|
||||
)
|
||||
|
||||
# 3b. Extra dependencies (no-deps) — audio model support etc.
|
||||
# 3b. Extra dependencies (no-deps) -- audio model support etc.
|
||||
_progress("extra codecs")
|
||||
pip_install(
|
||||
"Installing extras (no-deps)",
|
||||
|
|
@ -325,7 +325,7 @@ def install_python_stack() -> int:
|
|||
req = REQ_ROOT / "extras-no-deps.txt",
|
||||
)
|
||||
|
||||
# 4. Overrides (torchao, transformers) — force-reinstall
|
||||
# 4. Overrides (torchao, transformers) -- force-reinstall
|
||||
_progress("dependency overrides")
|
||||
pip_install(
|
||||
"Installing dependency overrides",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue