-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
357 lines (324 loc) · 8.08 KB
/
Copy pathpyproject.toml
File metadata and controls
357 lines (324 loc) · 8.08 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
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
[build-system]
requires = ["hatchling>=1.21.0", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "edgesam-onnxruntime"
dynamic = ["version"]
description = "Ultra-fast EdgeSAM implementation with ONNX Runtime and OpenCV"
readme = "README.md"
license = {text = "MIT"}
requires-python = ">=3.9"
authors = [
{name = "EdgeSAM Team", email = "edgesam@example.com"},
]
keywords = [
"ai",
"computer-vision",
"edge-computing",
"image-segmentation",
"machine-learning",
"onnx",
"opencv",
"segmentation",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: C++",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Image Recognition",
"Typing :: Typed",
]
dependencies = [
"numpy>=1.24.0",
"opencv-python>=4.8.0",
"onnxruntime>=1.12.1",
"pillow>=10.0.0",
"typing-extensions>=4.8.0; python_version<'3.11'",
]
[project.optional-dependencies]
dev = [
"coverage[toml]>=7.4.0",
"ipython>=8.12.0",
"mypy>=1.8.0",
"pre-commit>=3.6.0",
"pytest>=8.0.0",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.5.0",
"ruff>=0.3.0",
"uv>=0.1.0",
]
test = [
"coverage[toml]>=7.4.0",
"pytest>=8.0.0",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.5.0",
"pytest-benchmark>=4.0.0",
]
docs = [
"mkdocs>=1.5.0",
"mkdocs-material>=9.5.0",
"mkdocstrings[python]>=0.24.0",
]
gpu = [
"onnxruntime-gpu>=1.12.1",
]
all = [
"edgesam-onnxruntime[dev,test,docs,gpu]",
]
[project.urls]
Homepage = "https://github.com/umitkacar/edgeSAM-onnxruntime-cpp"
Documentation = "https://github.com/umitkacar/edgeSAM-onnxruntime-cpp#readme"
Repository = "https://github.com/umitkacar/edgeSAM-onnxruntime-cpp"
Issues = "https://github.com/umitkacar/edgeSAM-onnxruntime-cpp/issues"
[project.scripts]
edgesam = "edgesam_py.cli:main"
# ===== HATCH CONFIGURATION =====
[tool.hatch.version]
source = "vcs"
[tool.hatch.version.raw-options]
local_scheme = "no-local-version"
[tool.hatch.build.hooks.vcs]
version-file = "edgesam_py/_version.py"
[tool.hatch.build.targets.wheel]
packages = ["edgesam_py"]
[tool.hatch.build.targets.sdist]
exclude = [
"/.github",
"/docs",
"/.gitignore",
"/.pre-commit-config.yaml",
]
[tool.hatch.envs.default]
dependencies = [
"coverage[toml]>=7.4.0",
"pytest>=8.0.0",
"pytest-cov>=4.1.0",
]
[tool.hatch.envs.default.scripts]
test = "pytest {args:tests}"
test-cov = "coverage run -m pytest {args:tests}"
cov-report = [
"- coverage combine",
"coverage report",
]
cov = [
"test-cov",
"cov-report",
]
[tool.hatch.envs.lint]
detached = true
dependencies = [
"mypy>=1.8.0",
"ruff>=0.3.0",
]
[tool.hatch.envs.lint.scripts]
typing = "mypy --install-types --non-interactive {args:edgesam_py tests}"
style = [
"ruff check {args:.}",
"ruff format --check {args:.}",
]
fmt = [
"ruff check --fix {args:.}",
"ruff format {args:.}",
"style",
]
all = [
"style",
"typing",
]
[tool.hatch.envs.test]
dependencies = [
"coverage[toml]>=7.4.0",
"pytest>=8.0.0",
"pytest-cov>=4.1.0",
"pytest-xdist>=3.5.0",
"pytest-benchmark>=4.0.0",
]
[[tool.hatch.envs.test.matrix]]
python = ["3.9", "3.10", "3.11", "3.12"]
[tool.hatch.envs.test.scripts]
test = "pytest {args:tests}"
test-cov = "pytest --cov --cov-report=term-missing {args:tests}"
# ===== RUFF CONFIGURATION =====
[tool.ruff]
target-version = "py39"
line-length = 100
indent-width = 4
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"C90", # mccabe
"D", # pydocstyle
"E", # pycodestyle errors
"ERA", # eradicate
"F", # pyflakes
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"PL", # pylint
"PTH", # flake8-use-pathlib
"Q", # flake8-quotes
"RET", # flake8-return
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"T20", # flake8-print
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # pycodestyle warnings
]
ignore = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D107", # Missing docstring in __init__
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"E501", # Line too long (handled by black)
"ISC001", # Conflicts with formatter
"PLR0913", # Too many arguments
"S101", # Use of assert detected
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*" = [
"PLR2004", # Magic value used in comparison
"S101", # Use of assert detected
"ARG", # Unused function args
]
"__init__.py" = [
"F401", # Unused import
]
[tool.ruff.lint.isort]
known-first-party = ["edgesam_py"]
force-single-line = false
lines-after-imports = 2
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pylint]
max-args = 10
max-branches = 15
max-returns = 6
max-statements = 50
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true
# ===== MYPY CONFIGURATION =====
[tool.mypy]
python_version = "3.9"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_any_generics = false
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = false
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
extra_checks = true
show_error_codes = true
show_column_numbers = true
pretty = true
color_output = true
[[tool.mypy.overrides]]
module = [
"cv2.*",
"onnxruntime.*",
"PIL.*",
"numpy.*",
"pytest.*",
]
ignore_missing_imports = true
# ===== PYTEST CONFIGURATION =====
[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--showlocals",
"--tb=short",
"--cov=edgesam_py",
"--cov-branch",
"--cov-report=term-missing:skip-covered",
"--cov-report=html",
"--cov-report=xml",
]
testpaths = ["tests"]
pythonpath = ["."]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
"benchmark: marks tests as benchmark tests",
]
filterwarnings = [
"error",
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]
# ===== COVERAGE CONFIGURATION =====
[tool.coverage.run]
branch = true
parallel = true
source = ["edgesam_py"]
omit = [
"*/tests/*",
"*/__pycache__/*",
"*/site-packages/*",
"*/_version.py",
]
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if settings.DEBUG",
"raise AssertionError",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@(abc\\.)?abstractmethod",
]
[tool.coverage.html]
directory = "htmlcov"
[tool.coverage.xml]
output = "coverage.xml"
# ===== BANDIT CONFIGURATION =====
[tool.bandit]
exclude_dirs = [
"tests",
".venv",
".hatch",
]
skips = ["B101", "B601"]