forked from alibaba/zvec
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
266 lines (248 loc) · 7.58 KB
/
pyproject.toml
File metadata and controls
266 lines (248 loc) · 7.58 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
######################################################################################################
# Zvec: High-Performance Vector Database with PyBind11 & C++ Backend
######################################################################################################
[project]
name = "zvec"
dynamic = ["version"]
description = "A high-performance vector database engine with native C++ backend and Python bindings"
readme = "README.md"
license = { text = "Apache-2.0" }
authors = [
{ name = "zvec", email = "zvec@alibaba-inc.com" },
]
maintainers = [
{ name = "Zvec Core Team", email = "zvec@alibaba-inc.com" },
]
requires-python = ">=3.9"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Programming Language :: C++",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Database",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Python Modules",
]
keywords = [
"vector-database", "ann", "nearest-neighbor"
]
dependencies = [
"numpy >=1.23",
]
[project.urls]
Homepage = "https://github.com/alibaba/zvec"
Repository = "https://github.com/alibaba/zvec"
"Bug Tracker" = "https://github.com/alibaba/zvec/issues"
"Documentation" = "https://zvec.org"
[project.optional-dependencies]
test = [
"pytest >=8.0",
"pytest-cov >=4.1",
"pytest-mock >=3.12",
"cibuildwheel == 2.17.0",
]
docs = [
"mkdocs >=1.5",
"mkdocs-material >=9.5",
"mkdocstrings[python] >=0.24",
]
dev = [
"ruff >=0.4",
"black >=24.0",
"mypy >=1.8",
"pre-commit >=3.6",
"build >=1.0",
"twine >=4.0",
"numpy >=1.23",
# Inherit test deps
"pytest >=8.0",
"pytest-cov >=4.1",
"pytest-mock >=3.12",
"cibuildwheel == 2.17.0",
# Inherit docs deps
"mkdocs >=1.5",
"mkdocs-material >=9.5",
"mkdocstrings[python] >=0.24",
"pybind11-stubgen>=2.5.5",
"pybind11 >=3.0",
]
######################################################################################################
# BUILD SYSTEM CONFIGURATION (scikit-build-core)
######################################################################################################
[build-system]
requires = [
"scikit-build-core >=0.11",
"pybind11 >=3.0",
"setuptools_scm>=8.0",
"cmake>=3.26,<4.0",
"ninja>=1.11",
]
build-backend = "scikit_build_core.build"
[tool.scikit-build]
# Core settings
minimum-version = "0.11"
metadata.version.provider = "scikit_build_core.metadata.setuptools_scm"
# CMake configuration
cmake.version = ">=3.26,<4.0"
ninja.version = ">=1.11"
cmake.build-type = "Release"
install.strip = true # Strip symbols in release builds to reduce wheel size
# Build directory
build-dir = "build"
# Platform support
wheel.expand-macos-universal-tags = true
wheel.packages = ["python/zvec"]
# Source distribution
sdist.include = [
"README.md",
"LICENSE",
"pyproject.toml",
"CMakeLists.txt",
"src/**/*",
"stub/zvec/**/*",
"python/zvec/py.typed",
]
# CMake defines (env-overridable)
[tool.scikit-build.cmake.define]
BUILD_TOOLS = "OFF"
BUILD_PYTHON_BINDINGS = "ON"
# Setuptools config for test pypi
[tool.setuptools_scm]
local_scheme = "no-local-version"
version_scheme = "guess-next-dev"
######################################################################################################
# TESTING & QUALITY
######################################################################################################
[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
"-ra",
"--showlocals",
"--strict-markers",
"--strict-config",
"--tb=short",
]
xfail_strict = true
log_cli_level = "INFO"
filterwarnings = [
"error",
"ignore::pytest.PytestCacheWarning",
# Ignore numpy deprecation warnings in tests (if any)
"ignore:.*numpy.*:DeprecationWarning",
]
testpaths = ["python/tests"]
markers = [
"title: Custom marker for test title/description",
# "slow: marks tests as slow",
]
######################################################################################################
# BUILD WHEEL
######################################################################################################
[tool.cibuildwheel]
build = [
"cp310-*",
"cp311-*",
"cp312-*",
]
build-frontend = "build"
test-requires = ["pytest", "numpy"]
build-verbosity = 1
[tool.cibuildwheel.linux]
archs = ["auto"]
test-command = "cd {project} && pytest python/tests -v --tb=short"
manylinux-x86_64-image = "manylinux_2_28"
manylinux-aarch64-image = "manylinux_2_28"
# Skip 32-bit builds and musllinux
skip = ["*-manylinux_i686", "*-musllinux*"]
[tool.cibuildwheel.macos]
archs = ["arm64"]
environment = { MACOSX_DEPLOYMENT_TARGET = "11.0" }
######################################################################################################
# CODE QUALITY & FORMATTING (Ruff)
######################################################################################################
[tool.ruff]
target-version = "py310"
line-length = 88
exclude = [
"build/",
"dist/",
".git/",
".venv/",
"venv/",
]
[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
"NPY", # NumPy-specific
"PD", # pandas-vet
]
ignore = [
"PLR0913", # Too many arguments (common in bindings)
"PLR2004", # Magic value used in comparison
"UP045", "UP007", # Use list() instead of [] (breaks C++ init)
"EM101", "EM102", # Exception messages as literals (ok in tests/utils)
"B008", # Mutable default args (cautiously allowed in config)
"E731", # Lambda assignment (used in callbacks)
"B019", # `functools.lru_cache` on methods (handled manually)
"PLR0912", # Too many branches
"PLC0105", # Ignore contravariant
"RUF002", # Ignore Unicode
]
fixable = ["ALL"]
unfixable = []
# Ignore all errors in docstrings
[tool.ruff.lint.pydocstyle]
convention = "google" # or "numpy", "pep257"
ignore-decorators = ["typing.overload"]
[tool.ruff.lint.flake8-type-checking]
# Don't check code examples in docstrings
quote-annotations = true
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
known-first-party = ["zvec"]
[tool.ruff.lint.per-file-ignores]
"python/tests/**" = ["ALL"]
"bench/core/**" = ["ALL"]
"python/zvec/__init__.py" = [
"F401", # Unused import (for __all__)
"E402", # Module level import not at top (C++ module init order)
"PLE0605", # Invalid format for __all__
"RUF022", # __all__ is not sorted
]
"python/zvec/model/doc.py" = [
"RUF023", # Unused sort (for __slot__)
]
"python/zvec/extension/**" = [
"PLC0415", # Import outside top-level (dynamic imports in _get_model)
]
[tool.ruff.format]
indent-style = "space"
quote-style = "double"
line-ending = "lf"
skip-magic-trailing-comma = false