-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpyproject.toml
More file actions
148 lines (136 loc) · 4.07 KB
/
Copy pathpyproject.toml
File metadata and controls
148 lines (136 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "coreai-torch"
dynamic = ["version"]
description = "Convert PyTorch models to CoreAI format"
readme = "README.md"
license = { file = "LICENSE" }
classifiers = [
"License :: OSI Approved :: BSD License",
]
requires-python = ">=3.11"
dependencies = [
"coreai-core==1.0.0b1",
"ml-dtypes",
"networkx",
"numpy",
"packaging",
"scipy",
"sympy",
"torch>=2.8.0,<=2.11.0",
"typing-extensions",
"strenum",
"rich>=13.0,<16.0",
]
[project.optional-dependencies]
test = [
"coremltools",
"filecheck",
"mlx; sys_platform == 'darwin'",
"mlx_lm; sys_platform == 'darwin'",
"pytest",
"pytest-asyncio",
"pytest-randomly",
"pytest-rerunfailures",
"pytest-sugar",
"pytest-xdist",
"torchaudio",
"torchvision",
"transformers==4.57.3",
]
docs = [
"sphinx>=7.0",
"shibuya==2026.5.19",
"myst-nb>=1.0",
"nbmake>=1.5.0",
"ghp-import>=2.1.0",
"nest-asyncio>=1.5.0",
]
dev = [
"deptry>=0.20",
"nbstripout",
"pre-commit>=4.0",
"ruff>=0.12.0",
]
[project.urls]
Homepage = "https://github.com/apple/coreai-torch"
Repository = "https://github.com/apple/coreai-torch"
Issues = "https://github.com/apple/coreai-torch/issues"
[tool.setuptools.dynamic]
version = {attr = "coreai_torch.__version__.__version__"}
[tool.setuptools.packages.find]
where = ["."]
include = ["coreai_torch*"]
exclude = ["tests*"]
[tool.setuptools.package-data]
coreai_torch = ["py.typed"]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
asyncio_mode = "auto"
addopts = [
"--tb=short",
"--ff",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"dsl: marks Metal DSL kernel tests (macOS only)",
"composite: marks composite operation tests (require MLX + transformers)",
"compression: marks compression/quantization tests",
"ops: marks core operator tests",
"ir: marks tests that verify CoreAI IR output via filecheck",
]
[tool.ruff]
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "I", "W"]
ignore = ["E501"] # Line length is handled by the formatter
# Note: PLR, PLC, C90, D, EM, T20 rules are referenced in noqa comments
# across the codebase. Enable them incrementally in follow-up PRs.
[tool.ruff.lint.isort]
known-first-party = ["coreai_torch"]
[tool.deptry]
# `coreai_torch` is the project itself, and `tests` is the test package —
# silence self-imports flagged as transitive / missing.
known_first_party = ["coreai_torch", "tests"]
# Map distribution names to the import names they provide.
package_module_name_map = { "coreai-core" = "coreai" }
# Override the default exclude list (which includes "tests") so deptry sees
# test imports — otherwise every `[test]` extra is flagged DEP002 unused.
exclude = ["venv", ".venv", ".direnv", ".eggs", ".git", "setup.py", "__pycache__", "build", "dist", "docs"]
[tool.deptry.per_rule_ignores]
# Genuinely declared-but-unimported entries — listed explicitly so a future
# bad runtime dep added to [project.dependencies] is still caught:
# scipy — platform-pinned (darwin py<3.11) to constrain the resolver.
# torchaudio, torchvision
# — pulled by transformers/test fixtures transitively; no direct import.
# pytest-{randomly,rerunfailures,sugar,xdist}
# — pytest plugins, auto-loaded via entry points (never imported).
# sphinx, shibuya, myst-nb, nbmake, nest-asyncio, ghp-import
# — docs build infra used in docs/ (not scanned).
# ruff, deptry, nbstripout, pre-commit
# — dev tools invoked via CLI, never imported.
DEP002 = [
"scipy",
"torchaudio",
"torchvision",
"pytest-randomly",
"pytest-rerunfailures",
"pytest-sugar",
"pytest-xdist",
"pytest-asyncio",
"sphinx",
"shibuya",
"myst-nb",
"nbmake",
"nest-asyncio",
"ghp-import",
"ruff",
"deptry",
"nbstripout",
"pre-commit",
]