Files
mlx-knife/pyproject.toml
T
The BROKE Team cbd25c658d Release MLX Knife 1.0.2 - HF_HOME Cache Consistency & Corruption Fixes │
│                                                                                                      │
│   Major bug fixes addressing cache path inconsistencies and silent failures:                         │
│   - Fix Issue #11: HF_HOME environment variable handling - unified cache logic ensures consistent    │
│   /hub subdirectory usage                                                                            │
│   - Fix Issue #9: Silent failure on corrupted models with empty snapshots directories                │
│   - Enhanced download throttling with adaptive delays (512KB chunks, 2-3s for large files)           │
│   - Added migration warnings for legacy cache locations with clear user guidance                     │
│   - Improved corruption detection and deletion workflow consistency                                  │
│                                                                                                      │
│   Technical improvements:                                                                            │
│   - Unified cache architecture: CACHE_ROOT/hub for both default and HF_HOME scenarios                │
│   - Exception-safe memory management with enhanced baseline tracking                                 │
│   - Updated dependencies to latest tested versions (Python 3.9-3.13 support)                         │
│   - All 105 tests passing with real MLX model verification
2025-08-18 14:02:30 +02:00

152 lines
3.8 KiB
TOML

[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "mlx-knife"
dynamic = ["version"]
description = "ollama-style CLI for MLX models on Apple Silicon"
readme = "README.md"
requires-python = ">=3.9"
license = {text = "MIT"}
authors = [
{name = "The BROKE team", email = "broke@gmx.eu"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: MacOS",
"Environment :: Console",
]
dependencies = [
"huggingface-hub>=0.34.0",
"requests>=2.32.0",
"mlx>=0.28.0",
"mlx-lm>=0.26.0",
"fastapi>=0.116.0",
"uvicorn>=0.35.0",
"pydantic>=2.11.0",
]
[project.optional-dependencies]
test = [
"pytest>=7.4.0",
"pytest-asyncio>=0.21.0",
"pytest-timeout>=2.1.0",
"psutil>=5.9.0",
"pytest-mock>=3.11.0",
"pytest-cov>=4.1.0"
]
dev = [
"ruff>=0.1.0",
"mypy>=1.7.0",
"types-requests>=2.31.0"
]
[project.urls]
Homepage = "https://github.com/mzau/mlx-knife"
Issues = "https://github.com/mzau/mlx-knife/issues"
[project.scripts]
mlxk = "mlx_knife.cli:main"
mlx-knife = "mlx_knife.cli:main"
mlx_knife = "mlx_knife.cli:main"
[tool.setuptools]
packages = ["mlx_knife"]
[tool.setuptools.dynamic]
version = {attr = "mlx_knife.__version__"}
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
python_classes = "Test*"
python_functions = "test_*"
addopts = [
"-v",
"--tb=short",
"--strict-markers",
"--disable-warnings",
"--durations=10"
]
markers = [
"integration: integration tests (slower)",
"unit: unit tests (faster)",
"slow: slow running tests",
"requires_model: tests that need actual MLX models",
"network: tests that require network access"
]
timeout = 300
norecursedirs = [".git", ".tox", "dist", "build", "*.egg", "venv", "__pycache__"]
minversion = "6.0"
[tool.ruff]
target-version = "py39"
line-length = 88
extend-exclude = [
".git",
"__pycache__",
"venv*",
".venv",
"build",
"dist"
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function calls in argument defaults
# Python 3.9 compatibility policy - keep legacy typing for maximum compatibility
"UP006", # Use list instead of List (keep typing.List for Python 3.9 compat)
"UP035", # typing.Dict is deprecated (keep typing.Dict for Python 3.9 compat)
# Temporary ignores for release - TODO: fix these in future versions
"E402", # Module level import not at top of file
"E722", # Do not use bare except
"W293", # Blank line contains whitespace
"C414", # Unnecessary list() call
"B904", # Exception handling (raise from)
]
[tool.ruff.lint.per-file-ignores]
"tests/*" = ["B011"] # assert False in tests is ok
[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
show_error_codes = true
[[tool.mypy.overrides]]
module = [
"mlx.*",
"mlx_lm.*",
"huggingface_hub.*"
]
ignore_missing_imports = true