-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
258 lines (248 loc) · 8.6 KB
/
Copy pathpyproject.toml
File metadata and controls
258 lines (248 loc) · 8.6 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
[build-system]
build-backend = "setuptools.build_meta"
requires = [ "setuptools>=61" ]
[project]
name = "fuse-augmentations"
description = "Synthetic computer vision datasets in COCO/YOLO formats and fused image augmentation for PyTorch."
readme = "README.md"
keywords = [
"coco",
"computer vision",
"dataset generator",
"image augmentation",
"instance segmentation",
"keypoints",
"object detection",
"oriented bounding boxes",
"pose estimation",
"pytorch",
"synthetic data",
"yolo",
]
license = "Apache-2.0"
license-files = [ "LICENSE" ]
authors = [
{ name = "Jiri Borovec", email = "6035284+Borda@users.noreply.github.com" },
]
requires-python = ">=3.10"
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"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",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Image Recognition",
]
dynamic = [ "version" ]
dependencies = [
"numpy",
"pillow>=10",
"torch>=2.2",
]
optional-dependencies.albumentations = [
"albumentations>=2.0.0",
]
optional-dependencies.all = [
"albumentations>=2.0.0",
"kornia>=0.6.12",
"torchvision>=0.15",
]
optional-dependencies.cli = [
"fire>=0.6",
]
optional-dependencies.kornia = [
"kornia>=0.6.12",
]
optional-dependencies.torchvision = [
"torchvision>=0.15",
]
urls."Source Code" = "https://github.com/Borda/fuse-augmentations"
urls."Synthetic Datasets" = "https://borda.github.io/fuse-augmentations/datasets/"
urls.Changelog = "https://github.com/Borda/fuse-augmentations/blob/main/CHANGELOG.md"
urls.Documentation = "https://borda.github.io/fuse-augmentations/"
urls.Homepage = "https://github.com/Borda/fuse-augmentations"
urls.Issues = "https://github.com/Borda/fuse-augmentations/issues"
# Experimental third-party adapter extension point (see fuse_augmentations._backend.register_adapter).
# Downstream packages expose an adapter by declaring, in THEIR pyproject.toml:
# [project.entry-points."fuse_augmentations.adapters"]
# my_adapter = "my_pkg.module:register" # a zero-arg callable that calls register_adapter(...)
# Entries are loaded LAZILY on the first backend-detection miss, never at package import.
# The three built-in adapters self-register at import and are intentionally NOT listed here,
# so this project declares no entries of its own (an empty group is dropped by pyproject-fmt).
[dependency-groups]
dev = [
"hypothesis>=6.100",
"matplotlib>=3.7",
"mypy==1.19.1",
"pandas>=2.0",
"phmdoctest>=1.4",
"pytest>=8.3,<8.5",
"pytest-benchmark>=4",
"pytest-cov>=6.2,<7.1",
"pytest-doctestplus>=1.3",
"pyyaml>=6",
"scipy>=1.10",
"setuptools>=61",
# "tomlkit>=0.13",
"twine>=6.1,<6.3",
]
docs = [
"mkdocs-material>=9.7.6,<9.8",
"mkdocstrings[python]>=0.29",
]
benchmark = [
"ipython>=8.0",
"jupyterlab>=4.0",
"matplotlib>=3.7",
"pandas>=2.0",
"rich>=13.0",
"scikit-image>=0.22",
"tqdm>=4.60",
]
[tool.setuptools]
packages.find.where = [ "src" ]
packages.find.include = [ "fuse_aug*", "fuse_augmentations*" ]
package-data.fuse_augmentations = [ "data/letters/*.svg", "data/symbols/*.svg", "data/zoo/*.svg" ]
dynamic.version.attr = "fuse_augmentations.__about__.__version__"
[tool.ruff]
target-version = "py310"
line-length = 120
# [tool.ruff.pycodestyle]
# ignore-overlong-task-comments = true
format.preview = true
lint.select = [
"D", # see: https://pypi.org/project/pydocstyle
"E",
"F", # see: https://pypi.org/project/pyflakes
"I", # see: https://pypi.org/project/isort/
"N", # see: https://pypi.org/project/pep8-naming
"S", # see: https://pypi.org/project/flake8-bandit
"UP", # see: https://docs.astral.sh/ruff/rules/#pyupgrade-up
"W", # see: https://pypi.org/project/pycodestyle
]
lint.extend-select = [
"A", # see: https://pypi.org/project/flake8-builtins
"ANN", # see: https://pypi.org/project/flake8-annotations
"B", # see: https://pypi.org/project/flake8-bugbear
"C4", # see: https://pypi.org/project/flake8-comprehensions
"EXE", # see: https://pypi.org/project/flake8-executable
"ISC", # see: https://pypi.org/project/flake8-implicit-str-concat
"PERF", # see: https://pypi.org/project/perflint/
"PIE", # see: https://pypi.org/project/flake8-pie
"PLE", # see: https://pypi.org/project/pylint/
"PT", # see: https://pypi.org/project/flake8-pytest-style
"PYI", # see: https://pypi.org/project/flake8-pyi/
"Q", # see: https://pypi.org/project/flake8-quotes
"RET", # see: https://pypi.org/project/flake8-return
"RUF", # Ruff-specific rules
"SIM", # see: https://pypi.org/project/flake8-simplify
"T10", # see: https://pypi.org/project/flake8-debugger
"TID", # see: https://pypi.org/project/flake8-tidy-imports/
"YTT", # see: https://pypi.org/project/flake8-2020
]
lint.ignore = [
"E731", # Do not assign a lambda expression, use a def
]
lint.per-file-ignores."examples/**/*.py" = [
"ANN", # type annotations not required in example scripts
"D", # module docstring covers the script; per-function docs not required
"N", # relaxed naming (N, X, C, etc. are idiomatic in image/math code)
"S", # security rules relaxed for local example scripts
]
lint.per-file-ignores."experiments/**/*.py" = [
"ANN", # type annotations not required in experiment scripts
"D", # module docstring covers the script; per-function docs not required
"N", # relaxed naming (N, X, C, etc. are idiomatic in image/math code)
"S", # security rules relaxed for local experiment scripts
]
lint.per-file-ignores."src/fuse_aug/__init__.py" = [
"F401", # Star-import re-exports are intentional
]
lint.per-file-ignores."tests/**/*.py" = [
"ANN", # No type annotations required in tests
"D", # No docstrings required in tests
"E741", # Ambiguous variable name (I for identity matrix)
"N", # Naming conventions relaxed in tests (H, W, B, etc.)
"PT006", # parametrize argument style is relaxed
"S101", # Use of `assert` detected
]
# Unlike Flake8, default to a complexity level of 10.
lint.mccabe.max-complexity = 10
# Use Google-style docstrings.
lint.pydocstyle.convention = "google"
[tool.codespell]
# skip = "*.py"
quiet-level = 3
[tool.docformatter]
recursive = true
# some docstring start with r"""
wrap-summaries = 119
wrap-descriptions = 120
blank = true
[tool.pyproject-fmt]
# Keep full version numbers (e.g., 1.0.0 instead of 1.0) in dependency specifiers
keep_full_version = true
[tool.mypy]
files = [ "src/fuse_augmentations" ]
exclude = [ "^tests/" ]
ignore_missing_imports = true
python_version = "3.10"
strict = true
warn_unused_configs = true
[tool.pytest]
ini_options.testpaths = [ "src", "tests" ]
ini_options.norecursedirs = [
".claude",
".git",
".github",
"build",
"dist",
"docs",
"examples",
"experiments",
]
ini_options.addopts = [
"--strict-markers",
"--doctest-plus",
"--color=yes",
"--capture=sys",
]
ini_options.markers = [
"compile: tests torch.compile behaviour",
"gpu: requires a CUDA-capable GPU",
"integration: requires kornia or another external backend",
]
ini_options.xfail_strict = true
ini_options.filterwarnings = [
"error::DeprecationWarning",
"error::FutureWarning",
# Kornia calls torch.jit.script / script_method internally at import time.
# Newer torch deprecates both and, on Python 3.14+, warns they are "not
# supported" (a different wording than "is deprecated"). torch 2.10 raises
# these as DeprecationWarning while newer releases raise FutureWarning, so
# both categories are matched to keep the supported torch range collectable.
# Match each symbol with a trailing wildcard so either wording is ignored and
# collection of every Kornia-backed test is not aborted. script_method is
# matched separately from script so neither pattern shadows the other.
"ignore:`torch.jit.script_method`.*:DeprecationWarning",
"ignore:`torch.jit.script_method`.*:FutureWarning",
"ignore:`torch.jit.script`.*:DeprecationWarning",
"ignore:`torch.jit.script`.*:FutureWarning",
# TODO: torch.jit.script is on a removal path — once it is gone these ignores
# stop helping and kornia breaks at import. Track kornia for a torch.jit-free
# import path; if torch removes the symbol first, pin or drop the kornia leg
# of the CI matrix. Drop whichever warning category torch stops using.
]
ini_options.junit_duration_report = "call"
[tool.coverage]
report.exclude_lines = [
"pass",
"pragma: no cover",
]