-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
217 lines (189 loc) · 5.55 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
[build-system]
requires = ["setuptools>=61.0","setuptools_scm[toml]>=6.2"]
build-backend = "setuptools.build_meta"
[project]
name = "equine"
dynamic = ["version"]
authors = [
{ name = "Allan Wollaber"},
{ name = "Steven Jorgensen"},
{ name = "John Holodnak" },
{ name = "Jensen Dempsey" },
{ name = "Harry Li" },
]
maintainers = [
{ name = "Allan Wollaber"},
{ name = "Steven Jorgensen"},
]
description = "EQUINE^2: Establishing Quantified Uncertainty for Neural Networks"
readme = "README.md"
requires-python = ">=3.9"
dependencies = [
"torch >= 1.10.0",
"torchmetrics >= 0.6.0",
"numpy >= 1.22.0, <= 2.2.2",
"tqdm",
"beartype",
"icontract",
"scipy", # TODO: remove dependency on gaussian_kde
]
license = { text = "MIT" }
keywords = ["machine learning", "robustness", "pytorch", "responsible", "AI"]
classifiers = [
"Development Status :: 4 - Beta",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Programming Language :: Python :: 3 :: Only",
]
[project.optional-dependencies]
tests = [
"pytest >= 3.8",
"hypothesis >= 6.105.0, < 6.125.0",
"pre-commit >= 2.19",
"codespell"
]
docs = [
"mkdocs>=1.3",
"mkdocs-material",
"mkdocstrings-python",
"mkdocs-jupyter",
"mkdocs-literate-nav",
"mkdocs-gen-files",
"mkdocs-section-index",
]
[project.urls]
"Homepage" = "https://mit-ll-responsible-ai.github.io/equine/"
"Bug Tracker" = "https://github.com/mit-ll-responsible-ai/equine/issues"
"Source" = "https://github.com/mit-ll-responsible-ai/equine"
[tool.setuptools_scm]
write_to = "src/equine/_version.py"
#version_scheme = "no-guess-dev"
[tool.setuptools.package-data]
equine = ["py.typed"]
[tool.black]
line-length = 88
target-version = ['py311']
include = '\.pyi?$'
[tool.flake8]
max-line-length = 88
extend-ignore = ["E501"]
exclude = "src/equine/_version.py"
[tool.isort]
known_first_party = ["equine", "tests"]
profile = "black"
combine_as_imports = true
known_third_party = "torch,torchmetrics,numpy,tqdm,beartype,icontract,scikit-learn,scipy"
known_standard_library = "typing"
line_length = 88
include_trailing_comma = true
[tool.pytest]
addopts = "--cov=equine --cov-report=term-missing --cov-report=xml --cov-report=html --cov-fail-under=100 --durations=0"
testpaths = "tests"
[tool.coverage.run]
branch = true
[tool.coverage.report]
omit = ["src/equine/_version.py"]
exclude_lines = [
'pragma: no cover',
'def __repr__',
'raise NotImplementedError',
'raise ValueError',
'@(abc\.)?abstractmethod',
'@(typing\.)?overload',
'except ImportError:',
'except ModuleNotFoundError:',
'if (typing\.)?TYPE_CHECKING:',
'if sys\.version_info',
]
[tool.pyright]
include = ["src"]
exclude = [
"**/node_modules",
"**/__pycache__",
"src/equine/_version.py",
"**/.hypothesis",
"**/docs",
"**/.tox",
]
reportUnnecessaryTypeIgnoreComment = true
reportUnnecessaryIsInstance = false
[tool.codespell]
skip = 'docs/*'
[tool.tox]
legacy_tox_ini = """
[tox]
isolated_build = True
envlist = py39, py310, py311, py312
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
3.12: py312
[testenv]
description = Runs test suite parallelized in the specified python enviornment and
against number of available processes (up to 4).
Run `tox -e py39 -- -n 0` to run tests in a python 3.9 with
parallelization disabled.
passenv = *
deps = pytest
hypothesis
pytest-xdist
tzdata
commands = pytest tests/ {posargs: -n auto --maxprocesses=4}
[testenv:coverage]
description = Runs test suite and measures test-coverage. Fails if coverage is
below 97 percent. Run `tox -e coverage -- -n 0` to disable parallelization.
setenv = NUMBA_DISABLE_JIT=1
usedevelop = true
basepython = python3.11
deps = {[testenv]deps}
coverage[toml]
pytest-cov
commands = pytest --cov-report term-missing --cov-config=pyproject.toml --cov-fail-under=97 --cov=equine tests {posargs: -n auto --maxprocesses=4}
[testenv:pyright]
description = Ensure that the equine source code and test suite scan clean
under pyright and that the public API has a 100 percent
type-completeness score.
usedevelop = true
basepython = python3.11
deps = pyright
commands = pyright src/ --level=error
pyright --ignoreexternal --level=warning --verifytypes equine
[testenv:format]
description = Applies auto-flake (e.g. remove unsused imports), black, and isort
in-place on source files and test suite. Running this can help fix a
failing `enforce-format` run.
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]
description = Ensures that source materials code and docs and test suite adhere to
formatting and code-quality standards.
skip_install=true
basepython=python3.11
deps=black
isort
Flake8-pyproject
codespell
commands=
black src/ tests/ --diff --check
isort src/ tests/ --diff --check
flake8 src/ tests/
codespell src/ docs/
[testenv:docs]
description = Uses mkdocs to generate html for the docs. Stores the
results in `.tox/docs/build/html/`.
basepython=python3.11
deps=[docs]
commands=
mkdocs build --clean --strict
"""