-
Notifications
You must be signed in to change notification settings - Fork 457
Expand file tree
/
Copy pathpyproject.toml
More file actions
288 lines (257 loc) · 7.38 KB
/
Copy pathpyproject.toml
File metadata and controls
288 lines (257 loc) · 7.38 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
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
[build-system]
requires = [
"hatchling>=1.27,<1.28",
"setuptools_scm[toml]>=8",
# vcs-versioning 2.x changes .dev0 handling so v3.0.1.dev0 stays on
# 3.0.1rcN instead of PyMilvus master's intended 3.1.0rcN line.
"vcs-versioning<2",
]
build-backend = "hatchling.build"
[project]
name="pymilvus"
authors = [
{name='PyMilvus Team', email="pymilvus@zilliz.com"},
]
requires-python = '>=3.9'
description = "Python SDK for Milvus"
readme = "README.md"
keywords = ["milvus", "vector database", "sdk", "similarity search"]
dependencies=[
"grpcio>=1.66.2,!=1.68.0,!=1.68.1,!=1.69.0,!=1.70.0,!=1.70.1,!=1.71.0,!=1.72.1,!=1.73.0; python_version < '3.14'",
"grpcio>=1.75.1; python_version >= '3.14'",
"orjson>=3.10.15",
"protobuf>=5.27.2", # aligned with grpcio-tools generated codes
"python-dotenv>=1.0.1, <2.0.0",
"pandas>=1.2.4",
"cachetools>=5.0.0",
"requests>=2.20.0",
]
classifiers=[
"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",
"Programming Language :: Python :: 3.14",
"License :: OSI Approved :: Apache Software License",
]
dynamic = ["version"]
[project.urls]
"Homepage" = "https://milvus.io"
"Repository" = "https://github.com/milvus-io/pymilvus"
"Issues" = "https://github.com/milvus-io/pymilvus/issues"
[tool.uv]
package = true
default-groups = []
[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true
[project.optional-dependencies]
bulk_writer = [
"requests",
"minio>=7.0.0",
"pyarrow>=12.0.0",
"ml_dtypes",
"azure-storage-blob",
"urllib3",
]
model = [
"pymilvus.model>=0.3.0",
]
# Optional C implementation of XXH64 used by build_bloom_filter. Produces byte-identical
# blobs; without it the pure-Python fallback is used.
bloom_filter = [
"xxhash>=3.0.0",
]
milvus_lite = [
"milvus-lite>=2.4.0;sys_platform!='win32'",
# milvus-lite 2.5.1 uses pkg_resources on Python 3.9; setuptools 82 removed it.
"setuptools<82;python_version<'3.10'",
]
[dependency-groups]
codegen = [
# Pin grpcio-tools to 1.66.2: generated code in grpc_gen/ embeds GRPC_GENERATED_VERSION,
# so regenerating with a newer version would break older supported Python at import time.
"grpcio==1.66.2",
"grpcio-tools==1.66.2",
]
dev = [
"pytest>=5.3.4",
"pytest-cov>=5.0.0",
"pytest-timeout>=1.3.4",
"pytest-asyncio",
"Cython>=3.0.0",
"setuptools_scm[toml]>=8",
# Keep dev version tooling aligned with the build-system cap above.
"vcs-versioning<2",
"ruff>=0.12.9,<1",
"black",
# exercise the accelerated bloom_filter path in CI, not just the pure-Python fallback
"xxhash>=3.0.0",
# develop bulk_writer
"requests",
"minio>=7.0.0",
"pyarrow>=12.0.0",
"azure-storage-blob",
"urllib3",
"scipy",
# develop benchmark
"py-spy",
"memray;sys_platform!='win32'",
"pytest-benchmark[histogram]",
"ml_dtypes",
]
release = [
"check-wheel-contents>=0.6.1",
"twine>=6.2.0",
]
[tool.uv.dependency-groups]
codegen = { requires-python = ">=3.9,<3.14" }
release = { requires-python = ">=3.9" }
[tool.hatch.version]
source = "code"
path = "pymilvus/_version.py"
expression = "get_version()"
[tool.hatch.build.targets.sdist]
only-include = [
"CONTRIBUTING.md",
"CONTRIBUTING_CN.md",
"LICENSE",
"Makefile",
"README.md",
"pyproject.toml",
"pymilvus",
]
[tool.hatch.build.targets.wheel]
packages = ["pymilvus"]
[tool.black]
line-length = 100
target-version = ['py38']
include = '\.pyi?$'
# 'extend-exclude' excludes files or directories in addition to the defaults
extend-exclude = '''
# A regex preceded with ^/ will apply only to files and directories
# in the root of the project.
(
^/foo.py # exclude a file named foo.py in the root of the project
| .*/grpc_gen/
)
'''
[tool.ruff]
lint.select = [
"E",
"F",
"C90",
"I",
"N",
"B", "C", "G",
"A",
"ANN001",
"S", "T", "W", "ARG", "BLE", "COM", "DJ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP", "YTT"
]
lint.ignore = [
"N818",
"DTZ", # datatime related
"BLE", # blind-except (BLE001)
"SLF", # SLF001 Private member accessed: `_fetch_handler` [E]
"PD003",
"TRY003", # [ruff] TRY003 Avoid specifying long messages outside the exception class [E] TODO
"PLR2004", # Magic value used in comparison, consider replacing 65535 with a constant variable [E] TODO
"TRY301", #[ruff] TRY301 Abstract `raise` to an inner function [E]
"FBT001", #[ruff] FBT001 Boolean positional arg in function definition [E] TODO
"FBT002", # [ruff] FBT002 Boolean default value in function definition [E] TODO
"PLR0911", # Too many return statements (15 > 6) [E]
"G004", # [ruff] G004 Logging statement uses f-string [E]
"S603", # [ruff] S603 `subprocess` call: check for execution of untrusted input [E]
"N802", #[ruff] N802 Function name `OK` should be lowercase [E] TODO
"PD011", # [ruff] PD011 Use `.to_numpy()` instead of `.values` [E]
"COM812",
"FBT003", # [ruff] FBT003 Boolean positional value in function call [E] TODO
"ARG002",
"E501", # black takes care of it
"ARG005", # [ruff] ARG005 Unused lambda argument: `disable` [E]
"TRY400",
"PLR0912", # TODO
"PLR0915", # To many statements TODO
"C901", # TODO
"PYI041", # TODO
"E402",
"PLW1641", # TODO Object does not implement `__hash__` method
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
lint.fixable = [
"A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W",
"ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT",
"ICN", "INP", "ISC", "NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH",
"PYI", "RET", "RSE", "RUF", "SIM", "SLF", "TCH", "TID", "TRY", "UP",
"YTT",
]
lint.unfixable = []
show-fixes = true
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
"grpc_gen",
"__pycache__",
"pymilvus/client/stub.py",
]
# Same as Black.
line-length = 100
# Allow unused variables when underscore-prefixed.
lint.dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Keep a conservative lint syntax target; runtime support starts at requires-python.
target-version = "py38"
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 18
[tool.ruff.lint.pycodestyle]
max-doc-length = 100
[tool.ruff.lint.pylint]
max-args = 20
max-branches = 15
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = [
"format",
"next",
"object", # TODO
"id",
"dict", # TODO
"filter",
]
builtins-allowed-modules = ["types"]
[tool.coverage.run]
omit = [
"pymilvus/grpc_gen/*",
]
[tool.coverage.report]
omit = [
"pymilvus/grpc_gen/*",
]
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"raise NotImplementedError",
]