-
Notifications
You must be signed in to change notification settings - Fork 36
/
pyproject.toml
232 lines (212 loc) · 5.67 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
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
[project]
name = "inseq"
version = "0.7.0.dev0"
description = "Interpretability for Sequence Generation Models 🔍"
readme = "README.md"
requires-python = ">=3.10"
license = {file = "LICENSE"}
keywords = ["generative AI", "transformers", "natural language processing", "XAI", "explainable ai", "interpretability", "feature attribution", "machine translation"]
authors = [
{name = "The Inseq Team"},
{email = "[email protected]"}
]
maintainers = [
{name = "Gabriele Sarti"},
{email = "[email protected]"}
]
# Pypi classifiers: https://pypi.org/classifiers/
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Environment :: GPU",
"Environment :: GPU :: NVIDIA CUDA",
"Framework :: Jupyter",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Visualization",
"Typing :: Typed"
]
dependencies = [
"rich>=10.13.0",
"transformers[sentencepiece,tokenizers]>=4.22.0",
"protobuf>=3.20.1",
"captum>=0.7.0",
"numpy>=1.21.6",
"jaxtyping>=0.2.25",
"typeguard<=2.13.3",
"torch>=2.0",
"matplotlib>=3.5.3",
"tqdm>=4.64.0",
"treescope>=0.1.0",
"nvidia-cublas-cu11>=11.10.3.66; sys_platform=='Linux'",
"nvidia-cuda-cupti-cu11>=11.7.101; sys_platform=='Linux'",
"nvidia-cuda-nvrtc-cu11>=11.7.99; sys_platform=='Linux'",
"nvidia-cuda-runtime-cu11>=11.7.99; sys_platform=='Linux'",
"nvidia-cudnn-cu11>=8.5.0.96; sys_platform=='Linux'",
"nvidia-cufft-cu11>=10.9.0.58; sys_platform=='Linux'",
"nvidia-curand-cu11>=10.2.10.91; sys_platform=='Linux'",
"nvidia-cusolver-cu11>=11.4.0.1; sys_platform=='Linux'",
"nvidia-cusparse-cu11>=11.7.4.91; sys_platform=='Linux'",
"nvidia-nccl-cu11>=2.14.3; sys_platform=='Linux'",
"nvidia-nvtx-cu11>=11.7.91; sys_platform=='Linux'",
]
[project.optional-dependencies]
docs = [
"sphinx>=5.3.0",
"sphinxemoji>=0.2.0",
"sphinxext-opengraph>=0.4.2",
"sphinx-copybutton>=0.4.0",
"sphinx-gitstamp>=0.3.2",
"sphinx-design>=0.4.1",
"furo>=2022.12.7"
]
lint = [
"bandit>=1.7.4",
"safety>=3.1.0",
"pydoclint>=0.4.0",
"pre-commit>=2.19.0",
"pytest>=7.2.0",
"pytest-cov>=4.0.0",
"pytest-xdist>=3.5.0",
"ruff>=0.2.0",
"virtualenv>=20.26.6"
]
sklearn = [
"scikit-learn>=1.5.1",
"joblib>=1.3.2"
]
datasets = [
"datasets>=2.17.0"
]
notebook = [
"ipykernel>=6.29.2",
"ipywidgets>=8.1.2"
]
nltk = [
"nltk>=3.8.1",
]
[project.urls]
homepage = "https://github.com/inseq-team/inseq"
documentation = "https://inseq.org"
repository = "https://github.com/inseq-team/inseq"
changelog = "https://github.com/inseq-team/inseq/blob/main/CHANGELOG.md"
[project.scripts]
"inseq" = "inseq.commands.cli:main"
[tool.mypy]
# https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
python_version = "3.10"
strict = true
[tool.pytest.ini_options]
# https://docs.pytest.org/en/6.2.x/customize.html#pyproject-toml
# Directories that are not visited by pytest collector:
testpaths = "tests"
python_files = "test_*.py"
norecursedirs =["hooks", "*.egg", ".eggs", "dist", "build", "docs", ".tox", ".git", "__pycache__"]
doctest_optionflags = ["NUMBER", "NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]
markers = [
"slow",
"require_cuda_gpu"
]
addopts = [
"--strict-markers",
"--tb=short",
"--doctest-modules",
"--doctest-continue-on-failure",
"--disable-pytest-warnings",
"--color=yes"
]
[tool.coverage.run]
parallel = true
source = [
"inseq",
]
omit = [
"*/__main__.py",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no-cover",
"pass",
"raise",
"except",
"raise NotImplementedError",
]
[tool.bandit]
targets = ["inseq"]
skips = ["B301"]
[tool.setuptools]
packages = ["inseq"]
[tool.ruff]
target-version = "py310"
exclude = [
".git",
".vscode",
".github",
"__pycache__",
"docs/source/conf.py",
"old",
"build",
"htmlcov",
"dev_examples",
"dist",
".tox",
"temp",
"*.egg",
"venv",
".venv",
]
fix = true
line-length = 119
src = ["inseq", "examples", "tests"]
extend-include = ["*.ipynb"]
[tool.ruff.lint]
external = [
"DOC", # pydoclint
]
ignore = [
"B006", # mutable default argument
"C901", # function too complex
"E501", # line too long (handled by format)
"E731", # do not assign a lambda expression, use a def
"E741", # ambiguous variable name
"F722", # syntax error in forward annotation (as used by jaxtyping)
"F821", # undefined name
"PLR2004", # unnamed numerical constants used
"PLR0913", # too many arguments
"PLR0915", # too many statements
"W191", # indentation contains tabs (handled by format)
]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"C", # flake8-comprehensions
#"D", # flake8-docstrings
"B", # flake8-bugbear
"I", # isort
"UP", # flake8-pyupgrade
"PLC", # flake8-pylint
"PLE", # flake8-pylint
"PLR", # flake8-pylint
"PLW", # flake8-pylint
]
per-file-ignores = { "__init__.py" = ["F401"], "**/examples/*" = ["B018", "E402"] }
isort = { known-first-party = ["inseq"], order-by-type = true}
pylint = { max-branches = 22 }
pyupgrade = { keep-runtime-typing = true }
pydocstyle = { convention = "google" }
[tool.pydoclint]
style = 'google'
exclude = '\.git|\.tox|tests/data|some_script\.py'
require-return-section-when-returning-nothing = true