-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpyproject.toml
231 lines (211 loc) · 5.86 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
[tool.poetry]
name = "torch-conduit"
version = "0.4.3a0"
description = "Lightweight framework for dataloading with PyTorch and channeling the power of PyTorch Lightning"
authors = ["PAL <[email protected]>"]
license = "Apache License 2.0"
packages = [{ include = "conduit" }]
include = ["conduit/py.typed"]
classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Typing :: Typed",
]
keywords = [
"typing",
"python",
"pytorch",
"datasets",
"pytorch-lightning",
"lightning-bolts",
]
repository = "https://github.com/wearepal/conduit"
readme = "README.md"
[tool.poetry.dependencies]
numpy = "^1.22.3"
pandas = ">=1.3.3,<3.0"
python = ">=3.10,<3.13"
ranzen = ">=2.4.1"
scikit-learn = "^1.2.0"
typing-extensions = ">=4.4.0"
# download
gdown = { version = "^3.13.0", optional = true }
kaggle = { version = "^1.5.12", optional = true }
# image
albumentations = { version = "^1.0.0", optional = true }
opencv-python = { version = "^4.5.3", optional = true }
# audio
soundfile = { version = "*", markers = "platform_system == 'Windows'", optional = true }
sox = { version = "*", markers = "platform_system == 'Linux' or platform_system == 'macOS'", optional = true }
# hydra
hydra-core = { version = "^1.1.1", optional = true }
# logging
rich = { version = "^12.5.1", optional = true }
# fair
ethicml = { version = "^1.2.1", extras = ["data"], optional = true }
folktables = { version = "^0.0.12", optional = true }
[tool.poetry.extras]
download = ["gdown", "kaggle"]
image = ["albumentations", "opencv-python"]
audio = ["soundfile", "sox"]
hydra = ["hydra-core"]
logging = ["rich"]
fair = ["ethicml", "folktables"]
all = [
"gdown",
"kaggle", # download
"albumentations",
"opencv-python", # image
"soundfile",
"sox", # audio
"hydra-core", # hydra
"rich", # logging
"ethicml",
"folktables", # fair
]
[[tool.poetry.source]]
name = "torchcpu"
url = "https://download.pytorch.org/whl/cpu"
priority = "explicit"
[tool.poetry.group.torchcpu]
optional = true
[tool.poetry.group.torchcpu.dependencies]
pytorch-lightning = "^2.0.1.post0"
torch = { version = "*", source = "torchcpu", markers = "sys_platform == 'linux'" }
torchvision = { version = "*", source = "torchcpu", markers = "sys_platform == 'linux'" }
torchaudio = { version = "*", source = "torchcpu", markers = "sys_platform == 'linux'" }
[tool.poetry.group.dev.dependencies]
pre-commit = "*"
neoconfigen = { version = ">=2.3.3" }
[tool.poetry.group.test.dependencies]
pytest = "*"
[tool.poetry.group.typecheck.dependencies]
pandas-stubs = "*"
types-tqdm = "*"
types-pillow = "^9.5.0.4"
python-type-stubs = { git = "https://github.com/wearepal/python-type-stubs.git", rev = "8d5f608" }
[tool.poetry.group.lint.dependencies]
darglint = "^1.8.0"
ruff = ">=0.2.2"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
line-length = 100
target-version = "py310"
[tool.ruff.format]
quote-style = "preserve"
exclude = ["conduit/hydra/**"]
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"I", # isort
# "N", # naming
"NPY", # numpy
"PIE",
"PLC", # pylint convention
"PLE", # pylint error
# "PLR", # pylint refactor
"PLW", # pylint warning
"PTH", # use-pathlib
"SIM", # simplify
"UP", # pyupgrade
"W",
]
ignore = [
"E501", # line length
"E721", # `isinstance()` vs `type() == type()`
"E741", # ambiguous variable name
"F541", # f-string without placeholder
"NPY002", # np.random
"PLW2901", # overwriting loop variable
"PLC0105", # covariant typevars have to end in "_co"
"SIM108", # ternary operator
"UP038", # isinstance calls with `X | Y`
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F403"]
[tool.ruff.lint.isort]
known-third-party = [
"PIL",
"albumentations",
"attr",
"cv2",
"ethicml",
"hydra",
"numpy",
"omegaconf",
"pandas",
"pytest",
"pytorch_lightning",
"ranzen",
"requests",
"rich",
"sklearn",
"torch",
"torchaudio",
"torchmetrics",
"torchvision",
"tqdm",
]
extra-standard-library = ["typing_extensions"]
no-lines-before = ["future", "standard-library"]
force-sort-within-sections = true
split-on-trailing-comma = false
classes = ["MISSING", "NICO", "PACS", "SSRP", "ISIC"]
case-sensitive = true
[tool.pyright]
typeCheckingMode = "strict"
pythonVersion = "3.10"
reportMissingTypeArgument = "none"
reportCallInDefaultInitializer = "warning"
reportPropertyTypeMismatch = "none"
reportUninitializedInstanceVariable = "warning"
reportPrivateUsage = "none"
reportUnnecessaryTypeIgnoreComment = "warning"
reportUnnecessaryIsInstance = "warning"
reportUnnecessaryCast = "warning"
reportUnnecessaryComparison = "warning"
reportMissingTypeStubs = "warning"
# these errors are a bit annoying
reportUnknownMemberType = "none"
reportUnknownVariableType = "none"
reportUnknownParameterType = "none"
reportUnknownArgumentType = "none"
reportUnknownLambdaType = "none"
ignore = ["conduit/hydra/**"]
[tool.mypy]
python_version = "3.10"
no_implicit_optional = true
allow_redefinition = true
strict_equality = true
check_untyped_defs = true
warn_unreachable = true
disallow_any_unimported = false
disallow_untyped_defs = true
disallow_incomplete_defs = true
show_error_codes = true
warn_unused_ignores = false
warn_redundant_casts = true
exclude = ["conf.py"]
[[tool.mypy.overrides]]
module = [
"albumentations.*",
"flash.*",
"gdown.*",
"git.*",
"pl_bolts.*",
"requests.*",
"torchmetrics.*",
"torchvision.*",
"typing_inspect.*",
"wandb.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["torchmetrics.*"]
follow_imports = "skip"
#follow_imports_for_stubs = true