-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
225 lines (196 loc) · 6.31 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
# :auto build-system:
[build-system]
requires = ["poetry-core>=1.9"]
build-backend = "poetry.core.masonry.api"
# :auto build-system:
# :auto package-meta:
[tool.poetry]
name = "nrtk-jatic"
readme = "README.md"
packages = [{include = "nrtk_jatic", from="src"}]
documentation = "https://nrtk-jatic.readthedocs.io/"
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Unix',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
]
# :auto package-meta:
# package-specific meta, don't put this in "generated package-meta"
authors = ["Kitware, Inc. <[email protected]>"]
license = "Apache-2.0"
version = "0.2.0"
description = ""
[tool.poetry.dependencies]
# :auto python-version:
python = "^3.9"
# :auto python-version:
# Python capped to <3.13 because of:
# https://stackoverflow.com/questions/77431252/why-doesnt-poetry-select-the-good-version-of-my-dependency
numpy = {version = ">=1.22,<2.0", python = ">=3.9,<3.13" } # CVE-2021-34141
maite = "^0.6.0"
# This does not work with poetry install but does work with pip. Poetry
# has a PR working on it and hopefully won't be too far into the future
# https://github.com/python-poetry/poetry/pull/9553
nrtk = [
{version = ">=0.15.1"},
{version = ">=0.15.1", extras=["pybsm-graphics"], markers = "extra == 'pybsm-graphics'", optional = true},
{version = ">=0.15.1", extras=["pybsm-headless"], markers = "extra == 'pybsm-headless'", optional = true},
{version = ">=0.15.1", extras=["graphics"], markers = "extra == 'graphics'", optional = true},
{version = ">=0.15.1", extras=["headless"], markers = "extra == 'headless'", optional = true},
]
# REST API deps
fastapi = "^0.110.0"
httpx = "^0.27.0"
uvicorn = "^0.29.0"
# JSON Schema
pydantic = ">=2.6.4"
pydantic_settings = ">=2.2.1"
pyyaml = ">=6.0.1"
# Interoperability
responses = ">=0.25.0"
#JSON-Schema
# Optional for tools extra
kwcoco = {version = ">=0.2.18", optional = true}
# Optional for maite-cpu
torch = {version = ">=1.7,!=1.12.0", optional = true, source = "pytorch_cpu"}
torchvision = {version = ">=0.10.0", optional = true, source = "pytorch_cpu"}
[tool.poetry.extras]
tools = ["kwcoco"]
maite-cpu = ["torch", "torchvision"]
# these use the "markers" check in nrtk optional extras
pybsm-graphics = ["nrtk"]
pybsm-headless = ["nrtk"]
graphics = ["nrtk"]
headless = ["nrtk"]
# :auto dev-linting:
# Linting
[tool.poetry.group.dev-linting]
optional = true
[tool.poetry.group.dev-linting.dependencies]
flake8 = ">=6"
flake8-mutable = ">=1.2.0"
pyproject-flake8 = ">=6"
mypy = ">=0.991,!=1.11.0"
pre-commit = ">=2.20"
ruff = "^0.1.0"
types-setuptools = ">=65.6.0.1"
black = {version = ">=24.3.0", extras=["jupyter"]}
sphinx-lint = ">=1.0.0"
# :auto dev-linting:
types-PyYAML = ">=6.0.12.11"
types-requests = ">=2.31.0.10"
# :auto dev-docs:
# Docs
[tool.poetry.group.dev-docs]
optional = true
[tool.poetry.group.dev-docs.dependencies]
Sphinx = ">=5.3.0"
sphinx-copybutton = "^0.5.2"
sphinx-rtd-theme = ">=1.1.1"
sphinx-prompt = ">=1.5.0"
sphinx-click = ">=5.0.0"
livereload = ">=2.6.3"
# :auto dev-docs:
# :auto dev-testing:
# Testing
[tool.poetry.group.dev-testing]
optional = true
[tool.poetry.group.dev-testing.dependencies]
coverage = ">=6.5.0"
pytest = ">=7.2.0"
pytest-cov = ">=4.0.0"
syrupy = ">=4.0.0"
# Jupyter notebook testing
notebook = ">=7.2.2"
papermill = ">=2.4.0"
# :auto dev-testing:
maite = {version = "^0.6.0", extras = ["test"]}
[tool.poetry.scripts]
nrtk-perturber = "nrtk_jatic.utils.bin.nrtk_perturber_cli:nrtk_perturber_cli"
[tool.poetry.plugins."smqtk_plugins"]
###############################################################################
[[tool.poetry.source]]
# maite installs Torch with CUDA. In order to slim down installation for NRTKaaS
# docker container, we override maite's default torch version with the CPU version
name = "pytorch_cpu"
url = "https://download.pytorch.org/whl/cpu"
priority = "explicit"
# :auto pytest:
[tool.pytest.ini_options]
addopts = [
"-lv", # Show local in trace-backs.
"--doctest-modules", # Increased verbosity.
"--tb=long", # Trace-back print mode.
"--cov=./src/nrtk_jatic", # Cover our package specifically
"--cov=./tests", # Also cover our tests for dead spots
"--cov-report=term", # Coverage report to terminal
"--cov-report=xml:coverage.xml", # for external tool reporting
]
testpaths = [
"tests",
"src/nrtk_jatic",
]
doctest_optionflags = [
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
]
# :auto pytest:
# :auto flake8:
[tool.flake8]
exclude = [
"__pycache__",
".eggs",
".venv",
"docs",
"scripts"
]
# While a max length of 79 is encouraged, sometimes going over makes more sense
# for overall clarity.
max-line-length = 120
# :auto flake8:
# :auto black:
[tool.black]
# The regular expression pattern must be written as a single line;
# otherwise pytest-black fails to exclude the folders. For details see
# https://github.com/shopkeep/pytest-black/issues/36
exclude = '(/(\.git|.venv|.eggs|docs|scripts$)/)'
line-length = 120
# :auto black:
# :auto ruff:
[tool.ruff]
select = ["E", "W", "F", "I", "D", "A", "B", "N", "YTT", "C4", "PT"]
line-length = 120
ignore = [
# -- Ignore these rules, since they contradict our coding standards
"C408", # JATIC guidelines prefer "list()", rather than "[]", to create an empty list
"C416", # JATIC guidelines prefer "dict()", rather than "{}", to create an empty dict
# -- Ignoring these "Missing Docstring" errors for now, we will fix later
"D100", "D101", "D102", "D103", "D104", "D105", "D107"
]
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.pycodestyle]
max-doc-length = 120
[tool.ruff.isort]
known-first-party = ["nrtk_jatic"]
# :auto ruff:
# :auto mypy:
[tool.mypy]
python_version = "3.9"
disallow_untyped_defs = true
ignore_errors = false
ignore_missing_imports = true
strict_optional = false
incremental = false
[[tool.mypy.overrides]]
module = "tests.*"
ignore_errors = true
# :auto mypy: