-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathpyproject.toml
More file actions
281 lines (232 loc) · 6.76 KB
/
pyproject.toml
File metadata and controls
281 lines (232 loc) · 6.76 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
[build-system]
requires = ["setuptools", "wheel", "pybind11", "setuptools-rust"]
build-backend = "setuptools.build_meta"
[project]
name = "datumaro"
dynamic = ["version"]
description = "Dataset Management Framework (Datumaro)"
maintainers = [
{ name = "Intel Open Edge Platform" },
]
license-files = ["LICENSE"]
readme = "README.md"
requires-python = ">=3.10,<3.15"
classifiers = [
"Programming Language :: Python :: 3",
"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",
"Operating System :: OS Independent",
]
dependencies = [
"attrs>=25.3", # attrs doesn't follow semantic versioning
"cachetools~=7.0",
"defusedxml~=0.7",
"imagesize~=2.0",
"json-stream~=2.4",
"lxml~=6.0",
"numpy~=2.2",
"opencv-python-headless~=4.11",
"orjson~=3.10",
"pandas~=2.3",
"pillow~=12.0",
"pyarrow~=24.0",
"pycocotools~=2.0",
"PyYAML~=6.0",
"ruamel.yaml~=0.19.1",
"shapely~=2.1",
"tqdm~=4.67",
"typing_extensions~=4.15",
]
[project.scripts]
datum = "datumaro.cli.__main__:main"
[project.urls]
Homepage = "https://github.com/open-edge-platform/datumaro"
[project.optional-dependencies]
dev = [
"ruff",
"prek"
]
test = [
"pytest>=5.3.5",
"pytest-cov>=4.0.0",
"pytest-stress",
"pytest-html",
"coverage",
"pytest-csv",
"dill",
"tifffile",
]
docs = [
"markupsafe==3.0.3",
"nbconvert>=7.2.3",
"ipython==8.39.0",
"sphinx==7.4.7",
"pydata-sphinx-theme==0.17.1",
"sphinx-copybutton",
"sphinx-autoapi",
"myst-parser",
"nbsphinx",
"jupyter",
"jupytext",
"pandoc",
"sphinx-design",
"sphinx-toolbox",
]
# Tensorflow support
# Exclude Tensorflow from Python 3.13 as it is not supported yet
# Also exclude TensorFlow from the MacOS checks due to the following issue:
# https://github.com/tensorflow/tensorflow/issues/98563
tf = [
"tensorflow; python_version < '3.13' and sys_platform != 'darwin'",
]
# TODO: Reenable tfds
#tfds = [
# "tensorflow-datasets; python_version < '3.13' and sys_platform != 'darwin'",
# "absl-py>=0.12.0; python_version < '3.13' and sys_platform != 'darwin'",
#]
# PyTorch support
torch = ["torch>=2.9", "torchvision>=0.24"]
# Kaggle download support
kaggle = ["kaggle"]
# NDR, mpii file format, missing value detection in tabular data
scipy = ["scipy"]
# Tabular data processing
nlp = ["nltk", "tokenizers", "portalocker"]
# Comparator
tabulate = ["tabulate"]
# Any dependencies needed by the CLI
# 2.3 has an unlisted dependency on PyTorch, which we don't need
cli = ["tensorboardX>=1.8,!=2.3", "tabulate", "scipy", "matplotlib>=3.3.1"]
# Visualizer
visualizer = ["matplotlib>=3.3.1"]
# NYU Depth Dataset v2 file format
h5py = ["h5py>=3.15.0"]
# BraTS file format
nibabel = ["nibabel>=3.2.1"]
# AVA dataset
protobuf = ["protobuf"]
experimental = ["polars~=1.35"]
[tool.setuptools]
package-dir = {"" = "src"}
include-package-data = true
zip-safe = false
[tool.setuptools.packages.find]
where = ["src"]
include = ["datumaro*"]
[tool.setuptools.dynamic]
version = {attr = "datumaro.version.__version__"}
[tool.pybind11.ext_modules]
"datumaro._capi" = { sources = ["src/datumaro/capi/pybind.cpp"], extra_compile_args = ["-O3"] }
[[tool.setuptools-rust.ext-modules]]
target = "datumaro.rust_api"
path = "rust/Cargo.toml"
binding = "PyO3"
[tool.coverage.run]
branch = true
source = [
"src/",
]
omit = [
"src/datumaro/__main__.py",
"src/datumaro/version.py",
"tests/*",
]
[tool.cibuildwheel]
# reference docs - https://cibuildwheel.readthedocs.io/en/stable/options/#build-skip
build = "cp310-*_x86_64 cp311-*_x86_64 cp312-*_x86_64 cp313-*_x86_64 cp310-*_amd64 cp311-*_amd64 cp312-*_amd64 cp313-*_amd64 cp310-*_arm64 cp311-*_arm64 cp312-*_arm64 cp313-*_arm64"
[tool.cibuildwheel.linux]
before-all = [
"curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustup-init.sh",
"sh ./rustup-init.sh -y --default-toolchain stable --profile minimal"
]
environment = { PATH="$HOME/.cargo/bin:$PATH" }
[tool.coverage.report]
# Regexes for lines to exclude from consideration
exclude_lines = [
# Have to re-enable the standard pragma
'pragma: no cover',
# Don't complain about missing debug-only code:
'def __repr__',
'if\s+[\w\.()]+\.isEnabledFor\(log\.DEBUG\):',
# Don't complain if tests don't hit defensive assertion code:
'raise AssertionError',
'raise NotImplementedError',
# Don't complain if non-runnable code isn't run:
'if 0:',
'if __name__ == .__main__.:',
# Don't complain for the type checking code:
'if TYPE_CHECKING:'
]
# don't fail on the code that can be found
ignore_errors = true
skip_empty = true
[tool.ruff]
target-version = "py310"
line-length = 120
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
extend-exclude = [
"src/datumaro/plugins/openvino_plugin/samples"
]
[tool.ruff.lint]
select = ["ARG", "E", "F", "I", "N", "UP", "YTT", "ASYNC", "S", "COM", "C4", "FA", "PIE", "PYI", "Q", "RSE", "RET", "SIM",
"TID", "TC", "PL", "RUF", "C90", "D103", "ANN001", "ANN201", "ANN205", "FAST"]
ignore = ["N801", "N805","N806","N807", "N818", "COM812", "RET503", "SIM108", "SIM105", "PLR2004",
"RUF010", "TC001", "RUF012", "PLC0415"]
fixable = ["ALL"]
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.ruff.lint.per-file-ignores]
"*test*.py" = ["S", "ANN", "D", "ARG", "PLR", "N8", "RUF001", "E741", "E4", "F403", "F405"]
"!src/datumaro/experimental/**" = ["S", "ANN", "D", "ARG", "PLR", "PLC0415", "PLW", "C", "UP", "N8", "E741", "E402"]
"__init__.py" = [
"F4" # unused-import
]
"src/datumaro/plugins/data_formats/ava/ava_label_pb2.py" = [
"E501" # line-too-long
]
"notebooks/**" = [ "E501" ]
[tool.ruff.lint.isort]
split-on-trailing-comma = false
known-local-folder = []
[tool.ruff.lint.pylint]
max-args=7
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.nbqa.addopts]
ruff = ["--ignore=E402"]
[tool.mypy]
python_version = "3.10"
ignore_missing_imports = true
show_error_codes = true
[tool.bandit]
exclude_dirs = [
'.vscode/',
'.git/',
'build/',
'tests/',
]
tests = [ 'B301', 'B302', 'B303', 'B304', 'B305', 'B306', 'B308', 'B310', 'B311', 'B312', 'B313', 'B314', 'B315', 'B316', 'B317', 'B318', 'B319', 'B321', 'B323', 'B324', 'B401', 'B402', 'B403', 'B404', 'B405', 'B406', 'B407', 'B408', 'B409', 'B411', 'B412', 'B413']