feat(weights): add CLI for downloading weights from GitHub Releases
Streaming download w/ rich progress, SHA256 verification, platformdirs caching. Supports --tag, --asset, --force, --print-path flags + env var overrides. Console script: corridorkey-weights. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
7f1c2ee221
commit
e95bef4716
6
.gitignore
vendored
6
.gitignore
vendored
@ -21,5 +21,11 @@ samples/
|
||||
# Inference outputs
|
||||
output/
|
||||
|
||||
# Downloaded/cached weights
|
||||
weights/
|
||||
artifacts/
|
||||
*.safetensors
|
||||
*.partial
|
||||
|
||||
# OS files
|
||||
.DS_Store
|
||||
|
||||
73
README.md
73
README.md
@ -54,6 +54,79 @@ See `prompts/` for detailed phase instructions.
|
||||
uv sync --group dev
|
||||
```
|
||||
|
||||
### Download weights
|
||||
|
||||
Model weights (~400 MB) are distributed via GitHub Releases — not committed to git
|
||||
(binary blobs bloat history and exceed Git LFS free tiers).
|
||||
|
||||
**CLI (quickest):**
|
||||
|
||||
```bash
|
||||
# download latest release to platform cache dir
|
||||
uv run python -m corridorkey_mlx weights download
|
||||
|
||||
# specific tag
|
||||
uv run python -m corridorkey_mlx weights download --tag v1.0.0
|
||||
|
||||
# override asset name
|
||||
uv run python -m corridorkey_mlx weights download --asset corridorkey_mlx.safetensors
|
||||
|
||||
# force re-download
|
||||
uv run python -m corridorkey_mlx weights download --force
|
||||
|
||||
# print local path (for scripting)
|
||||
WEIGHTS=$(uv run python -m corridorkey_mlx weights download --print-path)
|
||||
```
|
||||
|
||||
If installed as a package, a `corridorkey-weights` console script is also available:
|
||||
|
||||
```bash
|
||||
corridorkey-weights download --tag v1.0.0 --print-path
|
||||
```
|
||||
|
||||
**Where weights are cached:**
|
||||
|
||||
| Platform | Path |
|
||||
|----------|------|
|
||||
| macOS | `~/Library/Caches/corridorkey_mlx/weights/<tag>/` |
|
||||
| Linux | `~/.cache/corridorkey_mlx/weights/<tag>/` |
|
||||
| Windows | `%LOCALAPPDATA%\corridorkey_mlx\Cache\weights\<tag>\` |
|
||||
|
||||
**Environment variable overrides:**
|
||||
|
||||
| Variable | Purpose |
|
||||
|----------|---------|
|
||||
| `CORRIDORKEY_MLX_WEIGHTS_REPO` | `owner/repo` for a different GitHub repo |
|
||||
| `CORRIDORKEY_MLX_WEIGHTS_TAG` | Default tag (instead of `latest`) |
|
||||
| `CORRIDORKEY_MLX_WEIGHTS_ASSET` | Default asset filename |
|
||||
| `GITHUB_TOKEN` | Auth token for higher API rate limits |
|
||||
|
||||
**Python API:**
|
||||
|
||||
```python
|
||||
from corridorkey_mlx.weights import download_weights
|
||||
|
||||
path = download_weights(tag="v1.0.0")
|
||||
```
|
||||
|
||||
### Publishing weights to a GitHub Release
|
||||
|
||||
Generate the checksum, then upload both files:
|
||||
|
||||
```bash
|
||||
# generate sha256 sidecar
|
||||
shasum -a 256 corridorkey_mlx.safetensors > corridorkey_mlx.safetensors.sha256
|
||||
|
||||
# create release and upload assets
|
||||
gh release create v1.0.0 \
|
||||
corridorkey_mlx.safetensors \
|
||||
corridorkey_mlx.safetensors.sha256 \
|
||||
--title "v1.0.0" --notes "Initial weights release"
|
||||
```
|
||||
|
||||
The downloader verifies the SHA256 automatically. If no `.sha256` sidecar or
|
||||
`SHA256SUMS` file is found, verification is skipped with a warning.
|
||||
|
||||
### Convert weights
|
||||
|
||||
Convert the PyTorch checkpoint to MLX safetensors (one-time):
|
||||
|
||||
@ -8,6 +8,8 @@ dependencies = [
|
||||
"mlx>=0.31.0",
|
||||
"numpy>=2.0.0",
|
||||
"pillow>=10.0.0",
|
||||
"platformdirs>=4.0.0",
|
||||
"requests>=2.31.0",
|
||||
"rich>=13.0.0",
|
||||
"safetensors>=0.4.0",
|
||||
]
|
||||
@ -25,6 +27,9 @@ reference = [
|
||||
"torchvision>=0.25.0",
|
||||
]
|
||||
|
||||
[project.scripts]
|
||||
corridorkey-weights = "corridorkey_mlx.weights_cli:main"
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
26
src/corridorkey_mlx/__main__.py
Normal file
26
src/corridorkey_mlx/__main__.py
Normal file
@ -0,0 +1,26 @@
|
||||
"""Entry point for `python -m corridorkey_mlx`.
|
||||
|
||||
Routes subcommands:
|
||||
python -m corridorkey_mlx weights download [flags]
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
|
||||
|
||||
def main() -> None:
|
||||
if len(sys.argv) >= 2 and sys.argv[1] == "weights":
|
||||
from corridorkey_mlx.weights_cli import main as weights_main
|
||||
|
||||
weights_main(sys.argv[2:])
|
||||
else:
|
||||
print("Usage: python -m corridorkey_mlx weights download [flags]")
|
||||
print()
|
||||
print("Subcommands:")
|
||||
print(" weights download Download model weights from GitHub Releases")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
327
src/corridorkey_mlx/weights.py
Normal file
327
src/corridorkey_mlx/weights.py
Normal file
@ -0,0 +1,327 @@
|
||||
"""Download and cache model weights from GitHub Releases.
|
||||
|
||||
Supports streaming download with progress, SHA256 verification,
|
||||
and platform-appropriate cache directories.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
import requests
|
||||
from platformdirs import user_cache_dir
|
||||
from rich.console import Console
|
||||
from rich.progress import (
|
||||
BarColumn,
|
||||
DownloadColumn,
|
||||
Progress,
|
||||
TextColumn,
|
||||
TimeRemainingColumn,
|
||||
TransferSpeedColumn,
|
||||
)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Config — single source of truth
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
PACKAGE_NAME = "corridorkey-mlx"
|
||||
PACKAGE_SLUG = "corridorkey_mlx"
|
||||
|
||||
DEFAULT_GITHUB_OWNER = "cristopheryates"
|
||||
DEFAULT_GITHUB_REPO = "corridorkey-mlx"
|
||||
|
||||
DEFAULT_ASSET_NAME = "corridorkey_mlx.safetensors"
|
||||
CHECKSUM_EXTENSIONS = (".sha256",)
|
||||
CHECKSUM_FILENAME = "SHA256SUMS"
|
||||
|
||||
DOWNLOAD_CHUNK_SIZE = 1024 * 256 # 256 KiB
|
||||
|
||||
ENV_PREFIX = "CORRIDORKEY_MLX"
|
||||
|
||||
|
||||
def _env(name: str, default: str | None = None) -> str | None:
|
||||
"""Read an env var with the package prefix."""
|
||||
return os.environ.get(f"{ENV_PREFIX}_{name}", default)
|
||||
|
||||
|
||||
def github_owner_repo() -> tuple[str, str]:
|
||||
repo_override = _env("WEIGHTS_REPO")
|
||||
if repo_override and "/" in repo_override:
|
||||
owner, repo = repo_override.split("/", 1)
|
||||
return owner, repo
|
||||
return DEFAULT_GITHUB_OWNER, DEFAULT_GITHUB_REPO
|
||||
|
||||
|
||||
def default_asset_name() -> str:
|
||||
return _env("WEIGHTS_ASSET") or DEFAULT_ASSET_NAME
|
||||
|
||||
|
||||
def default_tag() -> str:
|
||||
return _env("WEIGHTS_TAG") or "latest"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Cache directory
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def cache_dir(tag: str = "latest") -> Path:
|
||||
"""Platform-appropriate cache directory for a given release tag."""
|
||||
base = Path(user_cache_dir(PACKAGE_SLUG, appauthor=False))
|
||||
return base / "weights" / tag
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# GitHub Releases API
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
_console = Console(stderr=True)
|
||||
|
||||
|
||||
def _session() -> requests.Session:
|
||||
s = requests.Session()
|
||||
token = os.environ.get("GITHUB_TOKEN")
|
||||
if token:
|
||||
s.headers["Authorization"] = f"token {token}"
|
||||
s.headers["Accept"] = "application/vnd.github+json"
|
||||
s.headers["User-Agent"] = f"{PACKAGE_SLUG}-weights-downloader"
|
||||
return s
|
||||
|
||||
|
||||
def _api_base() -> str:
|
||||
owner, repo = github_owner_repo()
|
||||
return f"https://api.github.com/repos/{owner}/{repo}"
|
||||
|
||||
|
||||
def resolve_release(tag: str) -> dict[str, Any]:
|
||||
"""Fetch release metadata. 'latest' resolves via the GitHub API."""
|
||||
sess = _session()
|
||||
if tag == "latest":
|
||||
url = f"{_api_base()}/releases/latest"
|
||||
else:
|
||||
url = f"{_api_base()}/releases/tags/{tag}"
|
||||
|
||||
resp = sess.get(url, timeout=30)
|
||||
if resp.status_code == 404:
|
||||
raise SystemExit(f"Release not found: {tag}")
|
||||
resp.raise_for_status()
|
||||
return resp.json()
|
||||
|
||||
|
||||
def list_assets(release: dict[str, Any]) -> list[dict[str, Any]]:
|
||||
return release.get("assets", [])
|
||||
|
||||
|
||||
def find_asset(
|
||||
release: dict[str, Any], asset_name: str | None = None
|
||||
) -> dict[str, Any]:
|
||||
"""Find a specific asset in a release, or infer from platform."""
|
||||
assets = list_assets(release)
|
||||
target = asset_name or default_asset_name()
|
||||
|
||||
for a in assets:
|
||||
if a["name"] == target:
|
||||
return a
|
||||
|
||||
# list available assets for helpful error
|
||||
available = [a["name"] for a in assets]
|
||||
msg = f"Asset '{target}' not found in release '{release['tag_name']}'."
|
||||
if available:
|
||||
msg += f"\nAvailable assets: {', '.join(available)}"
|
||||
else:
|
||||
msg += "\nThis release has no assets."
|
||||
raise SystemExit(msg)
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Checksum helpers
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def _fetch_checksum_for_asset(
|
||||
release: dict[str, Any], asset_name: str, sess: requests.Session
|
||||
) -> str | None:
|
||||
"""Try to find a SHA256 checksum for `asset_name` from release assets.
|
||||
|
||||
Looks for:
|
||||
1. <asset_name>.sha256 (single-hash file)
|
||||
2. SHA256SUMS (multi-line, grep for asset_name)
|
||||
"""
|
||||
assets = {a["name"]: a for a in list_assets(release)}
|
||||
|
||||
# strategy 1: dedicated .sha256 sidecar
|
||||
sidecar = f"{asset_name}.sha256"
|
||||
if sidecar in assets:
|
||||
url = assets[sidecar]["browser_download_url"]
|
||||
resp = sess.get(url, timeout=30)
|
||||
resp.raise_for_status()
|
||||
return _parse_hash_line(resp.text, asset_name)
|
||||
|
||||
# strategy 2: SHA256SUMS manifest
|
||||
if CHECKSUM_FILENAME in assets:
|
||||
url = assets[CHECKSUM_FILENAME]["browser_download_url"]
|
||||
resp = sess.get(url, timeout=30)
|
||||
resp.raise_for_status()
|
||||
for line in resp.text.strip().splitlines():
|
||||
if asset_name in line:
|
||||
return _parse_hash_line(line, asset_name)
|
||||
|
||||
return None
|
||||
|
||||
|
||||
def _parse_hash_line(text: str, _asset_name: str) -> str | None:
|
||||
"""Extract a hex SHA256 hash from a line like 'abc123 filename' or just 'abc123'."""
|
||||
text = text.strip()
|
||||
match = re.match(r"([0-9a-fA-F]{64})", text)
|
||||
return match.group(1).lower() if match else None
|
||||
|
||||
|
||||
def verify_sha256(path: Path, expected: str) -> bool:
|
||||
h = hashlib.sha256()
|
||||
with open(path, "rb") as f:
|
||||
while chunk := f.read(DOWNLOAD_CHUNK_SIZE):
|
||||
h.update(chunk)
|
||||
return h.hexdigest() == expected.lower()
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Download
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def download_asset(
|
||||
release: dict[str, Any],
|
||||
asset: dict[str, Any],
|
||||
dest_dir: Path,
|
||||
*,
|
||||
force: bool = False,
|
||||
verify: bool = True,
|
||||
) -> Path:
|
||||
"""Stream-download a release asset to dest_dir with progress and verification."""
|
||||
dest_dir.mkdir(parents=True, exist_ok=True)
|
||||
final_path = dest_dir / asset["name"]
|
||||
partial_path = dest_dir / f"{asset['name']}.partial"
|
||||
|
||||
# skip if already cached
|
||||
if final_path.exists() and not force:
|
||||
if verify:
|
||||
_console.print(f"[dim]Cached: {final_path}[/dim]")
|
||||
sess = _session()
|
||||
expected = _fetch_checksum_for_asset(release, asset["name"], sess)
|
||||
if expected:
|
||||
if not verify_sha256(final_path, expected):
|
||||
_console.print(
|
||||
"[yellow]Checksum mismatch on cached file — re-downloading[/yellow]"
|
||||
)
|
||||
else:
|
||||
return final_path
|
||||
else:
|
||||
_console.print("[dim]No checksum available, using cached file[/dim]")
|
||||
return final_path
|
||||
else:
|
||||
return final_path
|
||||
|
||||
# stream download
|
||||
sess = _session()
|
||||
# Use browser_download_url for direct download (no auth needed for public repos)
|
||||
download_url = asset["browser_download_url"]
|
||||
total_size = asset.get("size", 0)
|
||||
|
||||
_console.print(f"Downloading [bold]{asset['name']}[/bold] ({_human_size(total_size)})")
|
||||
|
||||
resp = sess.get(
|
||||
download_url,
|
||||
stream=True,
|
||||
timeout=30,
|
||||
headers={"Accept": "application/octet-stream"},
|
||||
)
|
||||
resp.raise_for_status()
|
||||
|
||||
# use Content-Length if available (more accurate than API size)
|
||||
content_length = resp.headers.get("Content-Length")
|
||||
if content_length:
|
||||
total_size = int(content_length)
|
||||
|
||||
with Progress(
|
||||
TextColumn("[bold blue]{task.fields[filename]}"),
|
||||
BarColumn(),
|
||||
DownloadColumn(),
|
||||
TransferSpeedColumn(),
|
||||
TimeRemainingColumn(),
|
||||
console=_console,
|
||||
) as progress:
|
||||
task = progress.add_task("download", filename=asset["name"], total=total_size)
|
||||
|
||||
with open(partial_path, "wb") as f:
|
||||
for chunk in resp.iter_content(chunk_size=DOWNLOAD_CHUNK_SIZE):
|
||||
f.write(chunk)
|
||||
progress.advance(task, len(chunk))
|
||||
|
||||
# verify checksum before finalizing
|
||||
if verify:
|
||||
expected = _fetch_checksum_for_asset(release, asset["name"], sess)
|
||||
if expected:
|
||||
_console.print("Verifying SHA256…")
|
||||
if not verify_sha256(partial_path, expected):
|
||||
actual = _compute_sha256(partial_path)
|
||||
partial_path.unlink(missing_ok=True)
|
||||
raise SystemExit(
|
||||
f"SHA256 mismatch! Expected {expected}, "
|
||||
f"got {actual}. Download may be corrupted."
|
||||
)
|
||||
_console.print("[green]Checksum OK[/green]")
|
||||
else:
|
||||
_console.print(
|
||||
"[yellow]No checksum file found — skipping verification[/yellow]"
|
||||
)
|
||||
|
||||
# atomic rename
|
||||
partial_path.rename(final_path)
|
||||
return final_path
|
||||
|
||||
|
||||
def _compute_sha256(path: Path) -> str:
|
||||
h = hashlib.sha256()
|
||||
with open(path, "rb") as f:
|
||||
while chunk := f.read(DOWNLOAD_CHUNK_SIZE):
|
||||
h.update(chunk)
|
||||
return h.hexdigest()
|
||||
|
||||
|
||||
def _human_size(nbytes: int) -> str:
|
||||
for unit in ("B", "KB", "MB", "GB"):
|
||||
if nbytes < 1024:
|
||||
return f"{nbytes:.1f} {unit}"
|
||||
nbytes /= 1024 # type: ignore[assignment]
|
||||
return f"{nbytes:.1f} TB"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# High-level entry point (used by CLI and Python API)
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def download_weights(
|
||||
*,
|
||||
tag: str | None = None,
|
||||
asset_name: str | None = None,
|
||||
out: Path | None = None,
|
||||
force: bool = False,
|
||||
verify: bool = True,
|
||||
) -> Path:
|
||||
"""Download model weights, returning the local path.
|
||||
|
||||
Resolves tag, finds asset, downloads with progress, verifies checksum.
|
||||
"""
|
||||
resolved_tag = tag or default_tag()
|
||||
release = resolve_release(resolved_tag)
|
||||
actual_tag = release["tag_name"]
|
||||
|
||||
asset = find_asset(release, asset_name)
|
||||
|
||||
dest = out or cache_dir(actual_tag)
|
||||
return download_asset(release, asset, dest, force=force, verify=verify)
|
||||
89
src/corridorkey_mlx/weights_cli.py
Normal file
89
src/corridorkey_mlx/weights_cli.py
Normal file
@ -0,0 +1,89 @@
|
||||
"""CLI for downloading model weights from GitHub Releases.
|
||||
|
||||
Usage:
|
||||
python -m corridorkey_mlx.weights download [flags]
|
||||
corridorkey-weights download [flags]
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
|
||||
from corridorkey_mlx.weights import download_weights
|
||||
|
||||
|
||||
def build_parser() -> argparse.ArgumentParser:
|
||||
parser = argparse.ArgumentParser(
|
||||
prog="corridorkey-weights",
|
||||
description="Download corridorkey-mlx model weights from GitHub Releases.",
|
||||
)
|
||||
sub = parser.add_subparsers(dest="command")
|
||||
|
||||
dl = sub.add_parser("download", help="Download weights from a GitHub Release")
|
||||
dl.add_argument(
|
||||
"--tag",
|
||||
default=None,
|
||||
help='Release tag (default: "latest", or $CORRIDORKEY_MLX_WEIGHTS_TAG)',
|
||||
)
|
||||
dl.add_argument(
|
||||
"--asset",
|
||||
default=None,
|
||||
dest="asset_name",
|
||||
help="Asset filename override (default: corridorkey_mlx.safetensors)",
|
||||
)
|
||||
dl.add_argument(
|
||||
"--out",
|
||||
default=None,
|
||||
help="Output directory (default: platform cache dir)",
|
||||
)
|
||||
dl.add_argument(
|
||||
"--force",
|
||||
action="store_true",
|
||||
help="Re-download even if cached",
|
||||
)
|
||||
dl.add_argument(
|
||||
"--no-verify",
|
||||
action="store_true",
|
||||
help="Skip SHA256 verification",
|
||||
)
|
||||
dl.add_argument(
|
||||
"--print-path",
|
||||
action="store_true",
|
||||
help="Print the resolved local path and exit (for scripting)",
|
||||
)
|
||||
|
||||
return parser
|
||||
|
||||
|
||||
def main(argv: list[str] | None = None) -> None:
|
||||
parser = build_parser()
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
if args.command is None:
|
||||
parser.print_help()
|
||||
sys.exit(1)
|
||||
|
||||
if args.command == "download":
|
||||
from pathlib import Path
|
||||
|
||||
out = Path(args.out) if args.out else None
|
||||
path = download_weights(
|
||||
tag=args.tag,
|
||||
asset_name=args.asset_name,
|
||||
out=out,
|
||||
force=args.force,
|
||||
verify=not args.no_verify,
|
||||
)
|
||||
|
||||
if args.print_path:
|
||||
# print to stdout (not stderr) for scripting
|
||||
print(path)
|
||||
else:
|
||||
from rich.console import Console
|
||||
|
||||
Console(stderr=True).print(f"[green]Weights ready:[/green] {path}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
135
tests/test_weights.py
Normal file
135
tests/test_weights.py
Normal file
@ -0,0 +1,135 @@
|
||||
"""Unit tests for weights download module.
|
||||
|
||||
Tests config, caching, checksum verification, and CLI arg parsing
|
||||
without requiring real network access.
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import hashlib
|
||||
import os
|
||||
from typing import TYPE_CHECKING
|
||||
from unittest.mock import patch
|
||||
|
||||
from corridorkey_mlx.weights import (
|
||||
DEFAULT_ASSET_NAME,
|
||||
DEFAULT_GITHUB_OWNER,
|
||||
DEFAULT_GITHUB_REPO,
|
||||
_parse_hash_line,
|
||||
cache_dir,
|
||||
default_asset_name,
|
||||
default_tag,
|
||||
github_owner_repo,
|
||||
verify_sha256,
|
||||
)
|
||||
from corridorkey_mlx.weights_cli import build_parser
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
# -- Config defaults ---------------------------------------------------------
|
||||
|
||||
|
||||
class TestConfig:
|
||||
def test_default_owner_repo(self) -> None:
|
||||
owner, repo = github_owner_repo()
|
||||
assert owner == DEFAULT_GITHUB_OWNER
|
||||
assert repo == DEFAULT_GITHUB_REPO
|
||||
|
||||
def test_owner_repo_env_override(self) -> None:
|
||||
with patch.dict(os.environ, {"CORRIDORKEY_MLX_WEIGHTS_REPO": "other/repo"}):
|
||||
owner, repo = github_owner_repo()
|
||||
assert owner == "other"
|
||||
assert repo == "repo"
|
||||
|
||||
def test_default_asset_name(self) -> None:
|
||||
assert default_asset_name() == DEFAULT_ASSET_NAME
|
||||
|
||||
def test_asset_name_env_override(self) -> None:
|
||||
with patch.dict(os.environ, {"CORRIDORKEY_MLX_WEIGHTS_ASSET": "custom.st"}):
|
||||
assert default_asset_name() == "custom.st"
|
||||
|
||||
def test_default_tag(self) -> None:
|
||||
assert default_tag() == "latest"
|
||||
|
||||
def test_tag_env_override(self) -> None:
|
||||
with patch.dict(os.environ, {"CORRIDORKEY_MLX_WEIGHTS_TAG": "v2.0"}):
|
||||
assert default_tag() == "v2.0"
|
||||
|
||||
|
||||
# -- Cache directory ---------------------------------------------------------
|
||||
|
||||
|
||||
class TestCacheDir:
|
||||
def test_contains_tag(self) -> None:
|
||||
p = cache_dir("v1.0.0")
|
||||
assert p.parts[-1] == "v1.0.0"
|
||||
assert p.parts[-2] == "weights"
|
||||
|
||||
def test_latest_tag(self) -> None:
|
||||
p = cache_dir("latest")
|
||||
assert p.parts[-1] == "latest"
|
||||
|
||||
|
||||
# -- Checksum ----------------------------------------------------------------
|
||||
|
||||
|
||||
class TestChecksum:
|
||||
def test_parse_hash_only(self) -> None:
|
||||
h = "a" * 64
|
||||
assert _parse_hash_line(h, "file.bin") == h
|
||||
|
||||
def test_parse_hash_with_filename(self) -> None:
|
||||
h = "b" * 64
|
||||
assert _parse_hash_line(f"{h} file.bin", "file.bin") == h
|
||||
|
||||
def test_parse_hash_uppercase(self) -> None:
|
||||
h = "C" * 64
|
||||
assert _parse_hash_line(h, "file.bin") == h.lower()
|
||||
|
||||
def test_parse_hash_garbage(self) -> None:
|
||||
assert _parse_hash_line("not a hash", "file.bin") is None
|
||||
|
||||
def test_verify_sha256(self, tmp_path: Path) -> None:
|
||||
content = b"hello world"
|
||||
expected = hashlib.sha256(content).hexdigest()
|
||||
p = tmp_path / "test.bin"
|
||||
p.write_bytes(content)
|
||||
|
||||
assert verify_sha256(p, expected) is True
|
||||
assert verify_sha256(p, "0" * 64) is False
|
||||
|
||||
|
||||
# -- CLI arg parsing ---------------------------------------------------------
|
||||
|
||||
|
||||
class TestCLI:
|
||||
def test_download_defaults(self) -> None:
|
||||
parser = build_parser()
|
||||
args = parser.parse_args(["download"])
|
||||
assert args.command == "download"
|
||||
assert args.tag is None
|
||||
assert args.asset_name is None
|
||||
assert args.out is None
|
||||
assert args.force is False
|
||||
assert args.no_verify is False
|
||||
assert args.print_path is False
|
||||
|
||||
def test_download_all_flags(self) -> None:
|
||||
parser = build_parser()
|
||||
args = parser.parse_args([
|
||||
"download",
|
||||
"--tag", "v1.0",
|
||||
"--asset", "custom.st",
|
||||
"--out", "/tmp/w",
|
||||
"--force",
|
||||
"--no-verify",
|
||||
"--print-path",
|
||||
])
|
||||
assert args.tag == "v1.0"
|
||||
assert args.asset_name == "custom.st"
|
||||
assert args.out == "/tmp/w"
|
||||
assert args.force is True
|
||||
assert args.no_verify is True
|
||||
assert args.print_path is True
|
||||
110
uv.lock
generated
110
uv.lock
generated
@ -37,6 +37,79 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9a/3c/c17fb3ca2d9c3acff52e30b309f538586f9f5b9c9cf454f3845fc9af4881/certifi-2026.2.25-py3-none-any.whl", hash = "sha256:027692e4402ad994f1c42e52a4997a9763c646b73e4096e4d5d6db8af1d6f0fa", size = 153684, upload-time = "2026-02-25T02:54:15.766Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "charset-normalizer"
|
||||
version = "3.4.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/13/69/33ddede1939fdd074bce5434295f38fae7136463422fe4fd3e0e89b98062/charset_normalizer-3.4.4.tar.gz", hash = "sha256:94537985111c35f28720e43603b8e7b43a6ecfb2ce1d3058bbe955b73404e21a", size = 129418, upload-time = "2025-10-14T04:42:32.879Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/ed/27/c6491ff4954e58a10f69ad90aca8a1b6fe9c5d3c6f380907af3c37435b59/charset_normalizer-3.4.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:6e1fcf0720908f200cd21aa4e6750a48ff6ce4afe7ff5a79a90d5ed8a08296f8", size = 206988, upload-time = "2025-10-14T04:40:33.79Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/94/59/2e87300fe67ab820b5428580a53cad894272dbb97f38a7a814a2a1ac1011/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f819d5fe9234f9f82d75bdfa9aef3a3d72c4d24a6e57aeaebba32a704553aa0", size = 147324, upload-time = "2025-10-14T04:40:34.961Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/07/fb/0cf61dc84b2b088391830f6274cb57c82e4da8bbc2efeac8c025edb88772/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:a59cb51917aa591b1c4e6a43c132f0cdc3c76dbad6155df4e28ee626cc77a0a3", size = 142742, upload-time = "2025-10-14T04:40:36.105Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/62/8b/171935adf2312cd745d290ed93cf16cf0dfe320863ab7cbeeae1dcd6535f/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:8ef3c867360f88ac904fd3f5e1f902f13307af9052646963ee08ff4f131adafc", size = 160863, upload-time = "2025-10-14T04:40:37.188Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/09/73/ad875b192bda14f2173bfc1bc9a55e009808484a4b256748d931b6948442/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d9e45d7faa48ee908174d8fe84854479ef838fc6a705c9315372eacbc2f02897", size = 157837, upload-time = "2025-10-14T04:40:38.435Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/6d/fc/de9cce525b2c5b94b47c70a4b4fb19f871b24995c728e957ee68ab1671ea/charset_normalizer-3.4.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:840c25fb618a231545cbab0564a799f101b63b9901f2569faecd6b222ac72381", size = 151550, upload-time = "2025-10-14T04:40:40.053Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/55/c2/43edd615fdfba8c6f2dfbd459b25a6b3b551f24ea21981e23fb768503ce1/charset_normalizer-3.4.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ca5862d5b3928c4940729dacc329aa9102900382fea192fc5e52eb69d6093815", size = 149162, upload-time = "2025-10-14T04:40:41.163Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/03/86/bde4ad8b4d0e9429a4e82c1e8f5c659993a9a863ad62c7df05cf7b678d75/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:d9c7f57c3d666a53421049053eaacdd14bbd0a528e2186fcb2e672effd053bb0", size = 150019, upload-time = "2025-10-14T04:40:42.276Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1f/86/a151eb2af293a7e7bac3a739b81072585ce36ccfb4493039f49f1d3cae8c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:277e970e750505ed74c832b4bf75dac7476262ee2a013f5574dd49075879e161", size = 143310, upload-time = "2025-10-14T04:40:43.439Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b5/fe/43dae6144a7e07b87478fdfc4dbe9efd5defb0e7ec29f5f58a55aeef7bf7/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:31fd66405eaf47bb62e8cd575dc621c56c668f27d46a61d975a249930dd5e2a4", size = 162022, upload-time = "2025-10-14T04:40:44.547Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/80/e6/7aab83774f5d2bca81f42ac58d04caf44f0cc2b65fc6db2b3b2e8a05f3b3/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:0d3d8f15c07f86e9ff82319b3d9ef6f4bf907608f53fe9d92b28ea9ae3d1fd89", size = 149383, upload-time = "2025-10-14T04:40:46.018Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4f/e8/b289173b4edae05c0dde07f69f8db476a0b511eac556dfe0d6bda3c43384/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:9f7fcd74d410a36883701fafa2482a6af2ff5ba96b9a620e9e0721e28ead5569", size = 159098, upload-time = "2025-10-14T04:40:47.081Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d8/df/fe699727754cae3f8478493c7f45f777b17c3ef0600e28abfec8619eb49c/charset_normalizer-3.4.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:ebf3e58c7ec8a8bed6d66a75d7fb37b55e5015b03ceae72a8e7c74495551e224", size = 152991, upload-time = "2025-10-14T04:40:48.246Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/1a/86/584869fe4ddb6ffa3bd9f491b87a01568797fb9bd8933f557dba9771beaf/charset_normalizer-3.4.4-cp311-cp311-win32.whl", hash = "sha256:eecbc200c7fd5ddb9a7f16c7decb07b566c29fa2161a16cf67b8d068bd21690a", size = 99456, upload-time = "2025-10-14T04:40:49.376Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/65/f6/62fdd5feb60530f50f7e38b4f6a1d5203f4d16ff4f9f0952962c044e919a/charset_normalizer-3.4.4-cp311-cp311-win_amd64.whl", hash = "sha256:5ae497466c7901d54b639cf42d5b8c1b6a4fead55215500d2f486d34db48d016", size = 106978, upload-time = "2025-10-14T04:40:50.844Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7a/9d/0710916e6c82948b3be62d9d398cb4fcf4e97b56d6a6aeccd66c4b2f2bd5/charset_normalizer-3.4.4-cp311-cp311-win_arm64.whl", hash = "sha256:65e2befcd84bc6f37095f5961e68a6f077bf44946771354a28ad434c2cce0ae1", size = 99969, upload-time = "2025-10-14T04:40:52.272Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f3/85/1637cd4af66fa687396e757dec650f28025f2a2f5a5531a3208dc0ec43f2/charset_normalizer-3.4.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:0a98e6759f854bd25a58a73fa88833fba3b7c491169f86ce1180c948ab3fd394", size = 208425, upload-time = "2025-10-14T04:40:53.353Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9d/6a/04130023fef2a0d9c62d0bae2649b69f7b7d8d24ea5536feef50551029df/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:b5b290ccc2a263e8d185130284f8501e3e36c5e02750fc6b6bdeb2e9e96f1e25", size = 148162, upload-time = "2025-10-14T04:40:54.558Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/78/29/62328d79aa60da22c9e0b9a66539feae06ca0f5a4171ac4f7dc285b83688/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:74bb723680f9f7a6234dcf67aea57e708ec1fbdf5699fb91dfd6f511b0a320ef", size = 144558, upload-time = "2025-10-14T04:40:55.677Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/86/bb/b32194a4bf15b88403537c2e120b817c61cd4ecffa9b6876e941c3ee38fe/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:f1e34719c6ed0b92f418c7c780480b26b5d9c50349e9a9af7d76bf757530350d", size = 161497, upload-time = "2025-10-14T04:40:57.217Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/19/89/a54c82b253d5b9b111dc74aca196ba5ccfcca8242d0fb64146d4d3183ff1/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:2437418e20515acec67d86e12bf70056a33abdacb5cb1655042f6538d6b085a8", size = 159240, upload-time = "2025-10-14T04:40:58.358Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c0/10/d20b513afe03acc89ec33948320a5544d31f21b05368436d580dec4e234d/charset_normalizer-3.4.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:11d694519d7f29d6cd09f6ac70028dba10f92f6cdd059096db198c283794ac86", size = 153471, upload-time = "2025-10-14T04:40:59.468Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/61/fa/fbf177b55bdd727010f9c0a3c49eefa1d10f960e5f09d1d887bf93c2e698/charset_normalizer-3.4.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:ac1c4a689edcc530fc9d9aa11f5774b9e2f33f9a0c6a57864e90908f5208d30a", size = 150864, upload-time = "2025-10-14T04:41:00.623Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/05/12/9fbc6a4d39c0198adeebbde20b619790e9236557ca59fc40e0e3cebe6f40/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:21d142cc6c0ec30d2efee5068ca36c128a30b0f2c53c1c07bd78cb6bc1d3be5f", size = 150647, upload-time = "2025-10-14T04:41:01.754Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ad/1f/6a9a593d52e3e8c5d2b167daf8c6b968808efb57ef4c210acb907c365bc4/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:5dbe56a36425d26d6cfb40ce79c314a2e4dd6211d51d6d2191c00bed34f354cc", size = 145110, upload-time = "2025-10-14T04:41:03.231Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/30/42/9a52c609e72471b0fc54386dc63c3781a387bb4fe61c20231a4ebcd58bdd/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:5bfbb1b9acf3334612667b61bd3002196fe2a1eb4dd74d247e0f2a4d50ec9bbf", size = 162839, upload-time = "2025-10-14T04:41:04.715Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c4/5b/c0682bbf9f11597073052628ddd38344a3d673fda35a36773f7d19344b23/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:d055ec1e26e441f6187acf818b73564e6e6282709e9bcb5b63f5b23068356a15", size = 150667, upload-time = "2025-10-14T04:41:05.827Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e4/24/a41afeab6f990cf2daf6cb8c67419b63b48cf518e4f56022230840c9bfb2/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:af2d8c67d8e573d6de5bc30cdb27e9b95e49115cd9baad5ddbd1a6207aaa82a9", size = 160535, upload-time = "2025-10-14T04:41:06.938Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/e5/6a4ce77ed243c4a50a1fecca6aaaab419628c818a49434be428fe24c9957/charset_normalizer-3.4.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:780236ac706e66881f3b7f2f32dfe90507a09e67d1d454c762cf642e6e1586e0", size = 154816, upload-time = "2025-10-14T04:41:08.101Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a8/ef/89297262b8092b312d29cdb2517cb1237e51db8ecef2e9af5edbe7b683b1/charset_normalizer-3.4.4-cp312-cp312-win32.whl", hash = "sha256:5833d2c39d8896e4e19b689ffc198f08ea58116bee26dea51e362ecc7cd3ed26", size = 99694, upload-time = "2025-10-14T04:41:09.23Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/3d/2d/1e5ed9dd3b3803994c155cd9aacb60c82c331bad84daf75bcb9c91b3295e/charset_normalizer-3.4.4-cp312-cp312-win_amd64.whl", hash = "sha256:a79cfe37875f822425b89a82333404539ae63dbdddf97f84dcbc3d339aae9525", size = 107131, upload-time = "2025-10-14T04:41:10.467Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d0/d9/0ed4c7098a861482a7b6a95603edce4c0d9db2311af23da1fb2b75ec26fc/charset_normalizer-3.4.4-cp312-cp312-win_arm64.whl", hash = "sha256:376bec83a63b8021bb5c8ea75e21c4ccb86e7e45ca4eb81146091b56599b80c3", size = 100390, upload-time = "2025-10-14T04:41:11.915Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/97/45/4b3a1239bbacd321068ea6e7ac28875b03ab8bc0aa0966452db17cd36714/charset_normalizer-3.4.4-cp313-cp313-macosx_10_13_universal2.whl", hash = "sha256:e1f185f86a6f3403aa2420e815904c67b2f9ebc443f045edd0de921108345794", size = 208091, upload-time = "2025-10-14T04:41:13.346Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7d/62/73a6d7450829655a35bb88a88fca7d736f9882a27eacdca2c6d505b57e2e/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6b39f987ae8ccdf0d2642338faf2abb1862340facc796048b604ef14919e55ed", size = 147936, upload-time = "2025-10-14T04:41:14.461Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/89/c5/adb8c8b3d6625bef6d88b251bbb0d95f8205831b987631ab0c8bb5d937c2/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3162d5d8ce1bb98dd51af660f2121c55d0fa541b46dff7bb9b9f86ea1d87de72", size = 144180, upload-time = "2025-10-14T04:41:15.588Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/91/ed/9706e4070682d1cc219050b6048bfd293ccf67b3d4f5a4f39207453d4b99/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:81d5eb2a312700f4ecaa977a8235b634ce853200e828fbadf3a9c50bab278328", size = 161346, upload-time = "2025-10-14T04:41:16.738Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d5/0d/031f0d95e4972901a2f6f09ef055751805ff541511dc1252ba3ca1f80cf5/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5bd2293095d766545ec1a8f612559f6b40abc0eb18bb2f5d1171872d34036ede", size = 158874, upload-time = "2025-10-14T04:41:17.923Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/f5/83/6ab5883f57c9c801ce5e5677242328aa45592be8a00644310a008d04f922/charset_normalizer-3.4.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a8a8b89589086a25749f471e6a900d3f662d1d3b6e2e59dcecf787b1cc3a1894", size = 153076, upload-time = "2025-10-14T04:41:19.106Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/75/1e/5ff781ddf5260e387d6419959ee89ef13878229732732ee73cdae01800f2/charset_normalizer-3.4.4-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:bc7637e2f80d8530ee4a78e878bce464f70087ce73cf7c1caf142416923b98f1", size = 150601, upload-time = "2025-10-14T04:41:20.245Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d7/57/71be810965493d3510a6ca79b90c19e48696fb1ff964da319334b12677f0/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:f8bf04158c6b607d747e93949aa60618b61312fe647a6369f88ce2ff16043490", size = 150376, upload-time = "2025-10-14T04:41:21.398Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e5/d5/c3d057a78c181d007014feb7e9f2e65905a6c4ef182c0ddf0de2924edd65/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:554af85e960429cf30784dd47447d5125aaa3b99a6f0683589dbd27e2f45da44", size = 144825, upload-time = "2025-10-14T04:41:22.583Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e6/8c/d0406294828d4976f275ffbe66f00266c4b3136b7506941d87c00cab5272/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:74018750915ee7ad843a774364e13a3db91682f26142baddf775342c3f5b1133", size = 162583, upload-time = "2025-10-14T04:41:23.754Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/d7/24/e2aa1f18c8f15c4c0e932d9287b8609dd30ad56dbe41d926bd846e22fb8d/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:c0463276121fdee9c49b98908b3a89c39be45d86d1dbaa22957e38f6321d4ce3", size = 150366, upload-time = "2025-10-14T04:41:25.27Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/e4/5b/1e6160c7739aad1e2df054300cc618b06bf784a7a164b0f238360721ab86/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_s390x.whl", hash = "sha256:362d61fd13843997c1c446760ef36f240cf81d3ebf74ac62652aebaf7838561e", size = 160300, upload-time = "2025-10-14T04:41:26.725Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7a/10/f882167cd207fbdd743e55534d5d9620e095089d176d55cb22d5322f2afd/charset_normalizer-3.4.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:9a26f18905b8dd5d685d6d07b0cdf98a79f3c7a918906af7cc143ea2e164c8bc", size = 154465, upload-time = "2025-10-14T04:41:28.322Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/89/66/c7a9e1b7429be72123441bfdbaf2bc13faab3f90b933f664db506dea5915/charset_normalizer-3.4.4-cp313-cp313-win32.whl", hash = "sha256:9b35f4c90079ff2e2edc5b26c0c77925e5d2d255c42c74fdb70fb49b172726ac", size = 99404, upload-time = "2025-10-14T04:41:29.95Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/c4/26/b9924fa27db384bdcd97ab83b4f0a8058d96ad9626ead570674d5e737d90/charset_normalizer-3.4.4-cp313-cp313-win_amd64.whl", hash = "sha256:b435cba5f4f750aa6c0a0d92c541fb79f69a387c91e61f1795227e4ed9cece14", size = 107092, upload-time = "2025-10-14T04:41:31.188Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/af/8f/3ed4bfa0c0c72a7ca17f0380cd9e4dd842b09f664e780c13cff1dcf2ef1b/charset_normalizer-3.4.4-cp313-cp313-win_arm64.whl", hash = "sha256:542d2cee80be6f80247095cc36c418f7bddd14f4a6de45af91dfad36d817bba2", size = 100408, upload-time = "2025-10-14T04:41:32.624Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/2a/35/7051599bd493e62411d6ede36fd5af83a38f37c4767b92884df7301db25d/charset_normalizer-3.4.4-cp314-cp314-macosx_10_13_universal2.whl", hash = "sha256:da3326d9e65ef63a817ecbcc0df6e94463713b754fe293eaa03da99befb9a5bd", size = 207746, upload-time = "2025-10-14T04:41:33.773Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/10/9a/97c8d48ef10d6cd4fcead2415523221624bf58bcf68a802721a6bc807c8f/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:8af65f14dc14a79b924524b1e7fffe304517b2bff5a58bf64f30b98bbc5079eb", size = 147889, upload-time = "2025-10-14T04:41:34.897Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/10/bf/979224a919a1b606c82bd2c5fa49b5c6d5727aa47b4312bb27b1734f53cd/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:74664978bb272435107de04e36db5a9735e78232b85b77d45cfb38f758efd33e", size = 143641, upload-time = "2025-10-14T04:41:36.116Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/ba/33/0ad65587441fc730dc7bd90e9716b30b4702dc7b617e6ba4997dc8651495/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:752944c7ffbfdd10c074dc58ec2d5a8a4cd9493b314d367c14d24c17684ddd14", size = 160779, upload-time = "2025-10-14T04:41:37.229Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/67/ed/331d6b249259ee71ddea93f6f2f0a56cfebd46938bde6fcc6f7b9a3d0e09/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:d1f13550535ad8cff21b8d757a3257963e951d96e20ec82ab44bc64aeb62a191", size = 159035, upload-time = "2025-10-14T04:41:38.368Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/67/ff/f6b948ca32e4f2a4576aa129d8bed61f2e0543bf9f5f2b7fc3758ed005c9/charset_normalizer-3.4.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ecaae4149d99b1c9e7b88bb03e3221956f68fd6d50be2ef061b2381b61d20838", size = 152542, upload-time = "2025-10-14T04:41:39.862Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/16/85/276033dcbcc369eb176594de22728541a925b2632f9716428c851b149e83/charset_normalizer-3.4.4-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cb6254dc36b47a990e59e1068afacdcd02958bdcce30bb50cc1700a8b9d624a6", size = 149524, upload-time = "2025-10-14T04:41:41.319Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/f2/6a2a1f722b6aba37050e626530a46a68f74e63683947a8acff92569f979a/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:c8ae8a0f02f57a6e61203a31428fa1d677cbe50c93622b4149d5c0f319c1d19e", size = 150395, upload-time = "2025-10-14T04:41:42.539Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/60/bb/2186cb2f2bbaea6338cad15ce23a67f9b0672929744381e28b0592676824/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:47cc91b2f4dd2833fddaedd2893006b0106129d4b94fdb6af1f4ce5a9965577c", size = 143680, upload-time = "2025-10-14T04:41:43.661Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/7d/a5/bf6f13b772fbb2a90360eb620d52ed8f796f3c5caee8398c3b2eb7b1c60d/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:82004af6c302b5d3ab2cfc4cc5f29db16123b1a8417f2e25f9066f91d4411090", size = 162045, upload-time = "2025-10-14T04:41:44.821Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/df/c5/d1be898bf0dc3ef9030c3825e5d3b83f2c528d207d246cbabe245966808d/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:2b7d8f6c26245217bd2ad053761201e9f9680f8ce52f0fcd8d0755aeae5b2152", size = 149687, upload-time = "2025-10-14T04:41:46.442Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/a5/42/90c1f7b9341eef50c8a1cb3f098ac43b0508413f33affd762855f67a410e/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_s390x.whl", hash = "sha256:799a7a5e4fb2d5898c60b640fd4981d6a25f1c11790935a44ce38c54e985f828", size = 160014, upload-time = "2025-10-14T04:41:47.631Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/76/be/4d3ee471e8145d12795ab655ece37baed0929462a86e72372fd25859047c/charset_normalizer-3.4.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:99ae2cffebb06e6c22bdc25801d7b30f503cc87dbd283479e7b606f70aff57ec", size = 154044, upload-time = "2025-10-14T04:41:48.81Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/b0/6f/8f7af07237c34a1defe7defc565a9bc1807762f672c0fde711a4b22bf9c0/charset_normalizer-3.4.4-cp314-cp314-win32.whl", hash = "sha256:f9d332f8c2a2fcbffe1378594431458ddbef721c1769d78e2cbc06280d8155f9", size = 99940, upload-time = "2025-10-14T04:41:49.946Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/4b/51/8ade005e5ca5b0d80fb4aff72a3775b325bdc3d27408c8113811a7cbe640/charset_normalizer-3.4.4-cp314-cp314-win_amd64.whl", hash = "sha256:8a6562c3700cce886c5be75ade4a5db4214fda19fede41d9792d100288d8f94c", size = 107104, upload-time = "2025-10-14T04:41:51.051Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/da/5f/6b8f83a55bb8278772c5ae54a577f3099025f9ade59d0136ac24a0df4bde/charset_normalizer-3.4.4-cp314-cp314-win_arm64.whl", hash = "sha256:de00632ca48df9daf77a2c65a484531649261ec9f25489917f09e455cb09ddb2", size = 100743, upload-time = "2025-10-14T04:41:52.122Z" },
|
||||
{ url = "https://files.pythonhosted.org/packages/0a/4c/925909008ed5a988ccbb72dcc897407e5d6d3bd72410d69e051fc0c14647/charset_normalizer-3.4.4-py3-none-any.whl", hash = "sha256:7a32c560861a02ff789ad905a2fe94e3f840803362c84fecf1851cb4cf3dc37f", size = 53402, upload-time = "2025-10-14T04:42:31.76Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "click"
|
||||
version = "8.3.1"
|
||||
@ -66,6 +139,8 @@ dependencies = [
|
||||
{ name = "mlx" },
|
||||
{ name = "numpy" },
|
||||
{ name = "pillow" },
|
||||
{ name = "platformdirs" },
|
||||
{ name = "requests" },
|
||||
{ name = "rich" },
|
||||
{ name = "safetensors" },
|
||||
]
|
||||
@ -88,6 +163,8 @@ requires-dist = [
|
||||
{ name = "mlx", specifier = ">=0.31.0" },
|
||||
{ name = "numpy", specifier = ">=2.0.0" },
|
||||
{ name = "pillow", specifier = ">=10.0.0" },
|
||||
{ name = "platformdirs", specifier = ">=4.0.0" },
|
||||
{ name = "requests", specifier = ">=2.31.0" },
|
||||
{ name = "rich", specifier = ">=13.0.0" },
|
||||
{ name = "safetensors", specifier = ">=0.4.0" },
|
||||
]
|
||||
@ -737,6 +814,15 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f2/26/c56ce33ca856e358d27fda9676c055395abddb82c35ac0f593877ed4562e/pillow-12.1.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:cb9bb857b2d057c6dfc72ac5f3b44836924ba15721882ef103cecb40d002d80e", size = 7029880, upload-time = "2026-02-11T04:23:04.783Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "platformdirs"
|
||||
version = "4.9.2"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/1b/04/fea538adf7dbbd6d186f551d595961e564a3b6715bdf276b477460858672/platformdirs-4.9.2.tar.gz", hash = "sha256:9a33809944b9db043ad67ca0db94b14bf452cc6aeaac46a88ea55b26e2e9d291", size = 28394, upload-time = "2026-02-16T03:56:10.574Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/48/31/05e764397056194206169869b50cf2fee4dbbbc71b344705b9c0d878d4d8/platformdirs-4.9.2-py3-none-any.whl", hash = "sha256:9170634f126f8efdae22fb58ae8a0eaa86f38365bc57897a6c4f781d1f5875bd", size = 21168, upload-time = "2026-02-16T03:56:08.891Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pluggy"
|
||||
version = "1.6.0"
|
||||
@ -839,6 +925,21 @@ wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/f1/12/de94a39c2ef588c7e6455cfbe7343d3b2dc9d6b6b2f40c4c6565744c873d/pyyaml-6.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b", size = 149341, upload-time = "2025-09-25T21:32:56.828Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "requests"
|
||||
version = "2.32.5"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
dependencies = [
|
||||
{ name = "certifi" },
|
||||
{ name = "charset-normalizer" },
|
||||
{ name = "idna" },
|
||||
{ name = "urllib3" },
|
||||
]
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/c9/74/b3ff8e6c8446842c3f5c837e9c3dfcfe2018ea6ecef224c710c85ef728f4/requests-2.32.5.tar.gz", hash = "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf", size = 134517, upload-time = "2025-08-18T20:46:02.573Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/1e/db/4254e3eabe8020b458f1a747140d32277ec7a271daf1d235b70dc0b4e6e3/requests-2.32.5-py3-none-any.whl", hash = "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6", size = 64738, upload-time = "2025-08-18T20:46:00.542Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rich"
|
||||
version = "14.3.3"
|
||||
@ -1113,3 +1214,12 @@ sdist = { url = "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac8
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/18/67/36e9267722cc04a6b9f15c7f3441c2363321a3ea07da7ae0c0707beb2a9c/typing_extensions-4.15.0-py3-none-any.whl", hash = "sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548", size = 44614, upload-time = "2025-08-25T13:49:24.86Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "urllib3"
|
||||
version = "2.6.3"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/c7/24/5f1b3bdffd70275f6661c76461e25f024d5a38a46f04aaca912426a2b1d3/urllib3-2.6.3.tar.gz", hash = "sha256:1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed", size = 435556, upload-time = "2026-01-07T16:24:43.925Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/39/08/aaaad47bc4e9dc8c725e68f9d04865dbcb2052843ff09c97b08904852d84/urllib3-2.6.3-py3-none-any.whl", hash = "sha256:bf272323e553dfb2e87d9bfd225ca7b0f467b919d7bbd355436d3fd37cb0acd4", size = 131584, upload-time = "2026-01-07T16:24:42.685Z" },
|
||||
]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user