[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-05-16 21:34:59 +00:00
commit f0ec030fbc
2 changed files with 8 additions and 3 deletions

View file

@ -56,14 +56,17 @@ if sys.platform == "win32":
# before any import that pulls in bitsandbytes (mirrors worker.py logic).
if "BNB_ROCM_VERSION" not in os.environ:
import glob as _glob
_bnb_rocm_ver = None
try:
import importlib.util as _ilu
_bnb_spec = _ilu.find_spec("bitsandbytes")
if _bnb_spec and _bnb_spec.origin:
_pkg_dir = os.path.dirname(_bnb_spec.origin)
_dlls = _glob.glob(os.path.join(_pkg_dir, "libbitsandbytes_rocm*.dll"))
import re as _re_bnb
for _dll in sorted(_dlls):
_m = _re_bnb.search(r"libbitsandbytes_rocm(\d+)\.dll", _dll)
if _m:

View file

@ -2352,8 +2352,10 @@ class TestSetupShGccInstallDir:
# TEST: main.py -- BNB_ROCM_VERSION server startup + distributed stubs
# =============================================================================
_MAIN_PY_PATH = PACKAGE_ROOT / "studio" / "backend" / "main.py"
_HARDWARE_PY_PATH = PACKAGE_ROOT / "studio" / "backend" / "utils" / "hardware" / "hardware.py"
_MAIN_PY_PATH = PACKAGE_ROOT / "studio" / "backend" / "main.py"
_HARDWARE_PY_PATH = (
PACKAGE_ROOT / "studio" / "backend" / "utils" / "hardware" / "hardware.py"
)
class TestServerStartupRocmFixes:
@ -2371,7 +2373,7 @@ class TestServerStartupRocmFixes:
"""main.py BNB_ROCM_VERSION logic must be inside the win32 platform guard."""
source = _MAIN_PY_PATH.read_text(encoding = "utf-8")
win32_idx = source.find('sys.platform == "win32"')
bnb_idx = source.find("BNB_ROCM_VERSION")
bnb_idx = source.find("BNB_ROCM_VERSION")
assert win32_idx != -1 and bnb_idx != -1
assert win32_idx < bnb_idx