[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "nrfunc"
version = "2.2.0"
description = "神经区函数算法:成熟模型的函数化压缩与产物生成库(函数化 + 生成物)"
readme = "README.md"
license = "MIT"
requires-python = ">=3.9"
authors = [{ name = "lph", email = "414561114@qq.com" }]
keywords = ["quantization", "model-compression", "region", "functionalization", "sharding"]
classifiers = [
    "Programming Language :: Python :: 3",
    "Operating System :: OS Independent",
]
dependencies = [
    "numpy>=1.24",
    "torch>=2.0",
]

[project.optional-dependencies]
dev = ["pytest", "pytest-cov", "mypy"]
# rss_mb() 的内存实测需要可选包 psutil;未装时 rss_mb 返回 None,其余功能不受影响
memory = ["psutil"]

[tool.setuptools.packages.find]
where = ["src"]

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-q"

[tool.coverage.run]
source = ["nrfunc"]

[tool.coverage.report]
show_missing = true

[tool.mypy]
python_version = "3.12"
ignore_missing_imports = true
check_untyped_defs = false

# psutil 是可选依赖(无则 rss_mb 返回 None),无类型桩时跳过检查
[[tool.mypy.overrides]]
module = "psutil"
ignore_missing_imports = true