-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathpyproject.toml
237 lines (195 loc) · 5.66 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
[build-system]
requires = [
"setuptools >= 35.0.2",
"wheel >= 0.29.0",
"setuptools_scm[toml]",
]
build-backend = "setuptools.build_meta"
[project]
name = "rai_toolbox"
dynamic = ["version"]
description = "PyTorch-centric library for evaluating and enhancing the robustness of AI technologies"
readme = "README.md"
requires-python = ">=3.8"
dependencies = [
"torch >= 1.10.0",
"torchmetrics >= 0.6.0",
"typing-extensions >= 4.1.1",
]
license = { file = "LICENSE.txt" }
keywords = ["machine learning", "robustness", "pytorch", "responsible", "AI"]
authors = [
{ name = "Ryan Soklaski", email = "rsoklaski@gmail.com" },
{ name = "Justin Goodwin", email = "jgoodwin@ll.mit.edu" },
{ name = "Olivia Brown" },
{ name = "Michael Yee" },
]
maintainers = [{ name = "Ryan Soklaski", email = "rsoklaski@gmail.com" }]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
"Programming Language :: Python :: 3 :: Only",
]
[project.optional-dependencies]
tests = [
"pytest >= 3.8",
"hypothesis >= 6.41.0, < 6.49.0",
"mygrad >= 2.0.0",
"omegaconf >= 2.1.1",
]
mushin = [
"pytorch-lightning >= 1.5.0",
"hydra-zen >= 0.9.0",
"xarray >= 0.19.0",
"matplotlib >= 3.3",
"netCDF4 >= 1.5.8",
"protobuf <= 3.20.1", # strict TODO: Remove after tensorboard gets compatible https://github.com/tensorflow/tensorboard/issues/5708
]
datasets = ["torchvision >= 0.10.0"]
[project.urls]
"Homepage" = "https://mit-ll-responsible-ai.github.io/responsible-ai-toolbox/"
"Bug Reports" = "https://github.com/mit-ll-responsible-ai/responsible-ai-toolbox/issues"
"Source" = "https://github.com/mit-ll-responsible-ai/responsible-ai-toolbox"
[tool.setuptools_scm]
write_to = "src/rai_toolbox/_version.py"
version_scheme = "no-guess-dev"
[tool.setuptools]
package-dir = { "" = "src" }
[tool.setuptools.packages.find]
where = ["src"]
exclude = ["tests*", "tests.*"]
[tool.setuptools.package-data]
rai_toolbox = ["py.typed"]
[tool.isort]
known_first_party = ["rai_toolbox", "tests", "rai_experiments"]
profile = "black"
combine_as_imports = true
[tool.coverage.report]
omit = ["src/rai_toolbox/_version.py"]
[tool.codespell]
skip = '*.js,*.html,*ipynb,*.svg,*.css,docs/build'
[tool.pyright]
include = ["src"]
exclude = [
"**/node_modules",
"**/__pycache__",
"src/rai_toolbox/_version.py",
"**/third_party",
"**/project_tooling",
"./tests/test_augmentations/_old_implementation.py",
]
reportUnnecessaryTypeIgnoreComment = true
reportUnnecessaryIsInstance = false
reportPrivateImportUsage = false
[tool.pytest.ini_options]
xfail_strict=true
filterwarnings = [
"ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning",
"ignore:Future Hydra versions will no longer change working directory at job runtime by default.",
"ignore:distutils Version classes are deprecated",
"ignore:numpy.ndarray size changed, may indicate binary incompatibility",
"ignore:rai_toolbox.mushin.zen will be removed",
]
[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py38, py39, py310, py311
[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
[testenv]
deps = pytest
pytest-xdist
hypothesis
extras =
tests
commands = pytest tests/ {posargs: --hypothesis-profile ci -n auto --maxprocesses=4}
[testenv:min-deps] # test against minimum dependency versions
deps =
{[testenv]deps}
setuptools==59.5.0
torch==1.10.0
typing-extensions==4.1.1
torchmetrics==0.6.0
basepython = python3.8
[testenv:no-mushin]
extras =
tests
commands = pytest -n auto --hypothesis-profile ci tests
[testenv:coverage]
setenv = NUMBA_DISABLE_JIT=1
usedevelop = true
basepython = python3.11
extras = tests
mushin
datasets
deps = {[testenv]deps}
coverage
pytest-cov
commands = pytest -n auto --cov-report term-missing --cov-config=pyproject.toml --cov-branch --cov=rai_toolbox --hypothesis-profile ci tests {posargs: -n auto --maxprocesses=4}
[testenv:pre-release] # test against pre-releases of dependencies
pip_pre = true
extras =
tests
mushin
datasets
basepython = python3.9
[testenv:pyright] # test against pre-releases of dependencies
description = Scans src/ tests/ with pinned version of pyright
extras =
tests
mushin
datasets
deps =
--requirement deps/requirements-pyright.txt
basepython = python3.9
commands = pyright tests/ src/
[testenv:auto-format]
skip_install=true
deps =
autoflake
black
isort
commands =
autoflake --recursive --in-place --remove-duplicate-keys --remove-unused-variables src/ tests/
isort src/ tests/
black src/ tests/
[testenv:enforce-format]
skip_install=true
basepython=python3.9
deps=black
isort
flake8
codespell
pytest
commands=
black src/ tests/ --diff --check
isort src/ tests/ --diff --check
flake8 src/ tests/
codespell src/ docs/
pytest project_tooling/test_headers.py
# runs experiments that don't require additional dependencies
[testenv:experiments-checks]
basepython = python3.9
extras =
tests
datasets
deps =
experiments/
commands =
pytest experiments/tests
pytest experiments/adversarial_training/test_experiment.py
pytest experiments/madry/test_experiment.py
pytest experiments/universal_perturbation/test_experiment.py
"""