Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
255 lines (220 loc) · 5.68 KB
/
Copy pathpyproject.toml
File metadata and controls
255 lines (220 loc) · 5.68 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
################################################################
### Project definition
################################################################
[project]
name = "webdataset"
version = "0.2.107"
description = "High performance storage and I/O for deep learning and data processing."
authors = [
{name = "Thomas Breuel", email = "tmbdev+removeme@gmail.com"},
]
license = {text="MIT"}
readme = "README.md"
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.10"
dependencies = [
"braceexpand",
"numpy",
"pyyaml",
]
[project.urls]
homepage = "http://github.com/webdataset/webdataset"
repository = "http://github.com/webdataset/webdataset"
[build-system]
requires = ["setuptools>=45"]
build-backend = "setuptools.build_meta"
[project.scripts]
widsindex = "wids.wids_index:main"
[tool.setuptools]
packages = ["webdataset", "wids", "wsds"]
# [tool.setuptools_scm]
# write_to = "webdataset/__version__.py"
[tool.pre-commit]
repos = [
{ repo = "local", hooks = [
{ id = "black", name = "black", entry = "black .", language = "system", pass_filenames = false },
{ id = "isort", name = "isort", entry = "isort .", language = "system", pass_filenames = false },
{ id = "pytest-quick", name = "pytest-quick", entry = "pytest -v -m quick", language = "system", pass_filenames = false },
] },
]
################################################################
### PyTest Testing
################################################################
[tool.pytest.ini_options]
minversion = "6.0"
# addopts = "-ra -q"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
#python_classes = ["Test*"]
#python_functions = ["test_*"]
filterwarnings = [
"ignore::DeprecationWarning",
]
# defined in conftest.py instead
# markers = [
# "quick: marks tests as quick",
# "slow: marks tests as slow (deselect with '-m \"not slow\"')",
# "integration: marks integration tests",
# ]
[tool.coverage.run]
source = ["webdataset"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"if self.debug:",
"if __name__ == .__main__.:",
"raise NotImplementedError",
"pass",
]
ignore_errors = true
################################################################
### Tox Testing
################################################################
[tool.tox]
legacy_tox_ini = """
[tox]
#envlist = py{310,311,312}-{full,notorch}
envlist = py{310,311,312}-full
isolated_build = True
[testenv]
deps =
pytest
pytest-cov
full: .[dev]
notorch: .
commands =
full: pytest --cov=your_package_name --cov-report=xml
notorch: pytest -m notorch --cov=your_package_name --cov-report=xml
[testenv:py310-full]
basepython = python3.10
[testenv:py311-full]
basepython = python3.11
[testenv:py312-full]
basepython = python3.12
[testenv:py310-notorch]
basepython = python3.10
[testenv:py311-notorch]
basepython = python3.11
[testenv:py312-notorch]
basepython = python3.12
"""
################################################################
### Formatting
################################################################
[tool.black]
target-version = ['py310', 'py311', 'py312']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| build
| dist
)/
'''
[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
[tool.pydocstyle]
convention = "google"
match = '(?!test_).*\.py'
# match webdataset and wids only
match_dir = '(webdataset|wids)'
add_ignore = ["D100", "D104", "D203", "D213", "D406", "D407", "D413", "D205", "D107"]
# add_select = ["D402", "D417"]
# Explanation of ignored rules:
# D100: Missing docstring in public module
# D104: Missing docstring in public package
# D203: 1 blank line required before class docstring
# D213: Multi-line docstring summary should start at the second line
# D406: Section name should end with a newline
# D407: Missing dashed underline after section
# D413: Missing blank line after last section
# D402: First line should not be the function's "signature"
# D417: Missing argument descriptions in the docstring
[tool.ruff]
# Enable flake8-bugbear ('B'), mccabe ('C90'), isort ('I'), and pycodestyle ('E', 'W')
select = ["B", "C90", "I", "E", "W"]
# Never try to fix automatically
fixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
".git",
".mypy_cache",
".ruff_cache",
".venv",
"venv",
"__pypackages__",
"build",
"dist",
]
# Same as Black.
line-length = 120
# Assume Python 3.10.
target-version = "py310"
[tool.ruff.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.isort]
force-single-line = true
lines-after-imports = 2
[project.optional-dependencies]
dev = [
"autoflake",
"bandit",
"black",
"black[jupyter]",
"build",
"bump2version",
"flake8",
"imageio",
"isort",
"jupyter",
"jupyterlab",
"lmdb",
"matplotlib",
"mkdocs",
"mkdocs-autorefs",
"mkdocs-material",
"mkdocs-material-extensions",
"mkdocs-minify-plugin",
"mkdocstrings",
"mkdocstrings-python",
"msgpack",
"mypy",
"nbconvert",
"notebook",
"papermill",
"pdm",
"Pillow",
"pre-commit",
"pydocstyle",
"pytest",
"pytest-cov",
"pytorch_lightning",
"ray",
"ray[default]",
"ray[sgd]",
"ray[tune]",
"scipy",
"setuptools",
"torch",
"torchvision",
"transformers",
"twine",
"typer",
"wheel",
"icecream",
]