-
-
Notifications
You must be signed in to change notification settings - Fork 210
/
pyproject.toml
215 lines (200 loc) · 6 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
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "torchcam"
description = "Class activation maps for your PyTorch CNN models"
authors = [
{name = "François-Guillaume Fernandez", email = "[email protected]"}
]
readme = "README.md"
requires-python = ">=3.8,<4"
license = {file = "LICENSE"}
keywords = ["pytorch", "deep learning", "class activation map", "cnn", "gradcam"]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dynamic = ["version"]
dependencies = [
# cf. https://github.com/frgfm/torch-cam/discussions/148
"torch>=2.0.0,<3.0.0",
"numpy>=1.17.2,<2.0.0",
# cf. https://github.com/advisories/GHSA-98vv-pw6r-q6q4
# cf. https://github.com/pytorch/vision/issues/4934
# https://github.com/frgfm/Holocron/security/dependabot/5
"Pillow>=8.4.0,!=9.2.0",
"matplotlib>=3.7.0,<4.0.0",
]
[project.optional-dependencies]
test = [
"requests>=2.20.0,<3.0.0",
"torchvision>=0.15.0,<1.0.0",
"pytest>=7.3.2",
"pytest-cov>=3.0.0,<5.0.0",
"pytest-pretty>=1.0.0,<2.0.0",
]
quality = [
"ruff==0.6.1",
"mypy==1.10.0",
"types-Pillow",
"pre-commit>=3.0.0,<4.0.0",
]
docs = [
"sphinx>=3.0.0,!=3.5.0",
"furo>=2022.3.4",
"sphinxemoji>=0.1.8",
"sphinx-copybutton>=0.3.1",
"recommonmark>=0.7.1",
"sphinx-markdown-tables>=0.0.15",
# Indirect deps
# cf. https://github.com/readthedocs/readthedocs.org/issues/9038
"Jinja2<3.1",
]
demo = [
"streamlit>=0.65.0,<2.0.0",
"torchvision>=0.15.0,<1.0.0",
]
dev = [
# test
"requests>=2.20.0,<3.0.0",
"torchvision>=0.15.0,<1.0.0",
"pytest>=7.3.2",
"pytest-cov>=4.0.0,<5.0.0",
"pytest-pretty>=1.0.0,<2.0.0",
# style
"ruff==0.6.1",
"mypy==1.10.0",
"types-Pillow",
"pre-commit>=3.0.0,<4.0.0",
# docs
"sphinx>=3.0.0,!=3.5.0",
"furo>=2022.3.4",
"sphinxemoji>=0.1.8",
"sphinx-copybutton>=0.3.1",
"recommonmark>=0.7.1",
"sphinx-markdown-tables>=0.0.15",
"Jinja2<3.1",
]
[project.urls]
documentation = "https://frgfm.github.io/torch-cam"
repository = "https://github.com/frgfm/torch-cam"
tracker = "https://github.com/frgfm/torch-cam/issues"
changelog = "https://frgfm.github.io/torch-cam/latest/changelog.html"
[tool.setuptools]
zip-safe = true
[tool.setuptools.packages.find]
exclude = ["demo*", "docs*", "notebooks*", "scripts*", "tests*"]
[tool.pytest.ini_options]
testpaths = ["torchcam/"]
[tool.coverage.run]
source = ["torchcam/"]
[tool.ruff]
line-length = 120
target-version = "py39"
preview = true
[tool.ruff.lint]
select = [
"F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
"I", # isort
"N", # pep8-naming
"D101", "D103", # pydocstyle missing docstring in public function/class
"D201","D202","D207","D208","D214","D215","D300","D301","D417", "D419", # pydocstyle
"YTT", # flake8-2020
"ANN", # flake8-annotations
"ASYNC", # flake8-async
"S", # flake8-bandit
"BLE", # flake8-blind-except
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"CPY", # flake8-copyright
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"LOG", # flake8-logging
"PIE", # flake8-pie
"T20", # flake8-print
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-return
"SLF", # flake8-self
"SIM", # flake8-simplify
"ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
"PERF", # perflint
"NPY", # numpy
"FAST", # fastapi
"FURB", # refurb
"RUF", # ruff specific
"N", # pep8-naming
]
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"B904", # raise from
"C901", # too complex
"F403", # star imports
"E731", # lambda assignment
"C416", # list comprehension to list()
"ANN101", # missing type annotations on self
"ANN102", # missing type annotations on cls
"ANN002", # missing type annotations on *args
"ANN003", # missing type annotations on **kwargs
"COM812", # trailing comma missing
"N812", # lowercase imported as non-lowercase
"ISC001", # implicit string concatenation (handled by format)
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
]
exclude = [".git"]
[tool.ruff.lint.flake8-quotes]
docstring-quotes = "double"
[tool.ruff.lint.isort]
known-first-party = ["torchcam", "app"]
known-third-party = ["torch", "torchvision"]
[tool.ruff.lint.per-file-ignores]
"**/__init__.py" = ["I001", "F401", "CPY001"]
"scripts/**.py" = ["D", "T201", "N812", "S101", "ANN"]
".github/**.py" = ["D", "T201", "S602", "S101", "ANN"]
"docs/**.py" = ["E402", "D103", "ANN", "A001", "ARG001"]
"tests/**.py" = ["D103", "CPY001", "S101", "PT011", "ANN", "SLF001"]
"demo/**.py" = ["D103", "ANN"]
"setup.py" = ["T201"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
[tool.mypy]
python_version = "3.9"
files = "torchcam/"
show_error_codes = true
pretty = true
warn_unused_ignores = true
warn_redundant_casts = true
warn_return_any = true
no_implicit_optional = true
check_untyped_defs = true
implicit_reexport = false
disallow_untyped_defs = true
explicit_package_bases = true
[[tool.mypy.overrides]]
module = [
"PIL",
"matplotlib"
]
ignore_missing_imports = true