-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
295 lines (263 loc) · 7.15 KB
/
pyproject.toml
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
289
290
291
292
293
294
295
[tool.poetry]
name = "quadra"
version = "2.2.5"
description = "Deep Learning experiment orchestration library"
authors = [
"Federico Belotti <[email protected]>",
"Silvia Bianchetti <[email protected]>",
"Refik Can Malli <[email protected]>",
"Lorenzo Mammana <[email protected]>",
"Alessandro Polidori <[email protected]>",
]
license = "Apache-2.0"
readme = "README.md"
keywords = ["deep learning", "experiment", "lightning", "hydra-core"]
classifiers = [
"Programming Language :: Python :: 3",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"License :: OSI Approved :: Apache Software License",
]
homepage = "https://orobix.github.io/quadra"
repository = "https://github.com/orobix/quadra"
packages = [
{ include = "quadra" },
{ include = "hydra_plugins", from = "quadra_hydra_plugin" },
]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
quadra = "quadra.main:main"
[tool.poetry.dependencies]
python = ">=3.9,<3.11"
torch = { version = "2.1.2", source = "torch_cu121" }
torchvision = { version = "~0.16", source = "torch_cu121" }
pytorch_lightning = "~2.1"
torchsummary = "~1.5"
torchmetrics = "~0.10"
hydra_core = "~1.3"
hydra_colorlog = "~1.2"
hydra_optuna_sweeper = "~1.2"
mlflow-skinny = "^2.3.1"
boto3 = "~1.26"
minio = "~7.1"
tensorboard = "~2.11"
pillow = "~9.3"
pandas = "<2.0"
opencv_python_headless = "~4.7.0"
python_dotenv = "~0.21"
rich = "~13.2"
scikit_learn = "~1.2"
pydantic = "1.10.10"
grad-cam-orobix = "1.5.3.dev001"
matplotlib = "~3.6"
seaborn = "~0.12"
albumentations = "~1.3"
nvitop = "~0.11"
label_studio_converter = "~0.0"
scikit_multilearn = "~0.2"
tripy = "~1.0"
h5py = "~3.8"
timm = "0.9.12"
segmentation_models_pytorch-orobix = "0.3.3.dev1"
anomalib-orobix = "0.7.0.dev143"
xxhash = "~3.2"
torchinfo = "~1.8"
typing_extensions = { version = "4.11.0", python = "<3.10" }
# ONNX dependencies
onnx = { version = "1.15.0", optional = true }
onnxsim = { version = "0.4.28", optional = true }
onnxruntime_gpu = { version = "1.17.0", optional = true, source = "onnx_cu12" }
onnxconverter-common = { version = "^1.14.0", optional = true }
[[tool.poetry.source]]
name = "torch_cu121"
url = "https://download.pytorch.org/whl/cu121"
priority = "explicit"
[[tool.poetry.source]]
name = "onnx_cu12"
url = "https://pkgs.dev.azure.com/onnxruntime/onnxruntime/_packaging/onnxruntime-cuda-12/pypi/simple/"
priority = "explicit"
[tool.poetry.group.dev]
optional = true
[tool.poetry.group.dev.dependencies]
hydra-plugins = { path = "quadra_hydra_plugin" }
# Dev dependencies
interrogate = "~1.5"
pre_commit = "~3.0"
pylint = "~2.16"
types_pyyaml = "~6.0.12"
mypy = "^1.9.0"
pandas_stubs = "~1.5.3"
twine = "~4.0"
# Test dependencies
[tool.poetry.group.test]
optional = true
[tool.poetry.group.test.dependencies]
pytest = "^7"
pytest_cov = "~4.0"
pytest_lazy_fixture = "~0.6"
pytest_mock = "~3.11"
pytest_env = "~1.1"
# Documentation dependencies
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
mkdocs = "1.5.2"
mkdocs_literate_nav = "0.6.0"
mkdocs_section_index = "0.3.6"
mkdocstrings = "0.23.0"
mkdocs_autorefs = "0.5.0"
mkdocs_gen_files = "0.5.0"
mkdocs_material = "9.2.8"
mkdocstrings_python = "1.6.2"
mkdocs_material_extensions = "1.1.1"
mike = "1.1.2"
cairosvg = "2.7.0"
[tool.poetry.extras]
onnx = ["onnx", "onnxsim", "onnxruntime_gpu", "onnxconverter-common"]
[tool.poetry_bumpversion.file."quadra/__init__.py"]
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'
# Pytest
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = "test_*.py"
addopts = "--strict-markers --disable-pytest-warnings"
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"]
# Pytest coverage
[tool.coverage.run]
omit = []
[tool.prettier]
tab_width = 2
[tool.interrogate]
ignore_init_method = true
ignore_init_module = false
ignore_magic = true
ignore_semiprivate = false
ignore_private = false
ignore_module = true
ignore_property_decorators = true
fail_under = 100
verbose = 2
omit_covered_files = false
quiet = false
whitelist_regex = []
color = true
ignore_regex = [
"^get$",
"^mock_.*",
".*BaseClass.*",
".*on_train.*",
".*on_validation.*",
".*on_test.*",
".*on_predict.*",
".*forward.*",
".*backward.*",
".*training_step.*",
".*validation_step.*",
".*test_step.*",
".*predict_step.*",
".*train_epoch.*",
".*validation_epoch.*",
".*test_epoch.*",
".*on_fit.*",
]
generate-badge = "docs/images"
badge-format = "svg"
exclude = ["docs", "tests", "build", "dist", "local", "scripts"]
[tool.mypy]
# -> Level 1
# custom settings
show_error_codes = true
ignore_missing_imports = true
plugins = "numpy.typing.mypy_plugin"
allow_redefinition = true
# suggested settings
# # https://mypy.readthedocs.io/en/stable/existing_code.html?highlight=no_implicit_optional#introduce-stricter-options
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
no_implicit_optional = true
# -> Level 2
strict_equality = false
strict_concatenate = false
check_untyped_defs = false
# -> Level 3
disallow_subclassing_any = false
disallow_untyped_decorators = false
disallow_any_generics = false
disallow_any_unimported = false
disallow_untyped_calls = false
disallow_incomplete_defs = false
disallow_untyped_defs = false
# -> Level 4
no_implicit_reexport = false
warn_return_any = false
exclude = ["quadra/utils/tests", "tests"]
[tool.ruff]
extend-include = ["*.ipynb"]
target-version = "py39"
# Orobix guidelines
line-length = 120
indent-width = 4
[tool.ruff.lint]
select = [
# pycodestyle
"E",
# pycodestyle
"W",
# Pyflakes
"F",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# isort
"I",
# flake8-comprehensions
"C4",
# docstrings
"D",
# Pylint
"PL",
]
ignore = [
"D100", # Missing docstring in public module
# this is controlled by interrogate with exlude_regex
# we can skip it here
"D102",
"D104", # Missing docstring in public package
"D105", # Missing docstring for magic method (def __*__)
"D107", # Missing docstring in __init__
"D205", # no blank line after summary line. Usually we violate this rule
"E731", # Do not assign a lambda expression, use a def
"E741", # Checks for the use of the characters 'l', 'O', or 'I' as variable names.
"E402", # Module level import not at top of file
"SIM108", # https://github.com/astral-sh/ruff/issues/5528
"SIM117", # Single with statement instead of multiple with statements
# Pylint specific ignores
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0914", # too-many-locals
"PLR0915", # too-many-statements
"PLR1702", # too-many-nested-blocks
"PLW1514", # unspecified-encoding
"PLR2004", # magic-value-comparison
]
exclude = ["Makefile", ".gitignore", "tests"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.pytest_env]
OMP_NUM_THREADS = 4
OPENBLAS_NUM_THREADS = 4
MKL_NUM_THREADS = 4
VECLIB_MAXIMUM_THREADS = 4
NUMEXPR_NUM_THREADS = 4