IQ.Pilot Release Commit @ 98a2c61

This commit is contained in:
IQ.Lvbs CI [bot]
2026-08-19 14:10:31 -05:00
parent dca8172e55
commit 7e3d70380a
55 changed files with 699 additions and 114 deletions

View File

@@ -11,6 +11,7 @@ MODELS_DIR = MODELD_DIR / 'models'
BASEDIR = MODELD_DIR.parents[2]
METADATA_SCRIPT = MODELD_DIR / 'get_model_metadata.py'
PYPROJECT = BASEDIR / 'pyproject.toml'
TINYGRAD_REVISION_FILE = BASEDIR / 'artifacts/package_sources/tinygrad/.iqpilot-revision'
MODEL_NAMES = ['dmonitoring_model']
@@ -30,9 +31,16 @@ def _file_sha256(path: Path) -> str:
@functools.lru_cache(maxsize=1)
def _tinygrad_revision() -> str:
match = re.search(r'"tinygrad @ git\+https://[^@]+@([0-9a-f]{40})"', PYPROJECT.read_text())
if match is None:
raise RuntimeError("missing pinned tinygrad revision")
return match.group(1)
if match is not None:
return match.group(1)
try:
revision = TINYGRAD_REVISION_FILE.read_text().strip()
except OSError as e:
raise RuntimeError("missing pinned tinygrad revision") from e
if re.fullmatch(r'[0-9a-f]{40}', revision) is None:
raise RuntimeError("invalid pinned tinygrad revision")
return revision
CHECK_PATH = MODELS_DIR / 'prebuilt_check.json'

View File

@@ -49,3 +49,17 @@ def test_source_checkout_is_not_packaged_prebuilt(tmp_path, monkeypatch):
monkeypatch.setattr(prebuilt_models, 'CHECK_PATH', check_path)
assert not prebuilt_models.packaged_prebuilt_matches('dmonitoring_model')
def test_vendored_tinygrad_revision(tmp_path, monkeypatch):
revision = '0123456789abcdef0123456789abcdef01234567'
pyproject = tmp_path / 'pyproject.toml'
revision_file = tmp_path / '.iqpilot-revision'
pyproject.write_text('dependencies = ["tinygrad"]\n')
revision_file.write_text(f'{revision}\n')
monkeypatch.setattr(prebuilt_models, 'PYPROJECT', pyproject)
monkeypatch.setattr(prebuilt_models, 'TINYGRAD_REVISION_FILE', revision_file)
prebuilt_models._tinygrad_revision.cache_clear()
assert prebuilt_models._tinygrad_revision() == revision
prebuilt_models._tinygrad_revision.cache_clear()