/
pyproject.toml
192 lines (169 loc) 路 5.02 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
# Poetry pyproject.toml: https://python-poetry.org/docs/pyproject/
[build-system]
requires = ["poetry_core>=1.2.0"]
build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "inseq"
version = "0.2.0"
description = "Interpretability for Sequence-to-sequence models 馃攳"
readme = "README.md"
authors = ["The Inseq Team"]
maintainers = ["gsarti <gabriele.sarti996@gmail.com>"]
license = "Apache Software License 2.0"
repository = "https://github.com/inseq-team/inseq"
homepage = "https://github.com/inseq-team/inseq"
# Keywords description https://python-poetry.org/docs/pyproject/#keywords
keywords = ["seq2seq", "transformers", "natural language processing", "XAI", "explainable ai", "interpretability"]
# Pypi classifiers: https://pypi.org/classifiers/
classifiers = [ #! Update me
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Environment :: GPU",
"Environment :: GPU :: NVIDIA CUDA",
"Environment :: GPU :: NVIDIA CUDA :: 11.3",
"Framework :: Jupyter",
"Framework :: Sphinx",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Visualization",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10"
]
[tool.poetry.scripts]
# Entry points for the package https://python-poetry.org/docs/pyproject/#scripts
"inseq" = "inseq.commands.cli:main"
[tool.poetry.dependencies]
python = ">=3.8,<3.12"
rich = "^10.13.0"
transformers = { version = "^4.20.1", extras = ["sentencepiece", "tokenizers", "torch"] }
protobuf = "^3.20.2"
captum = "^0.5.0"
numpy = "^1.22.4"
torchtyping = "^0.1.4"
json-tricks = "^3.15.5"
torch = "~1.12.1"
scipy = "^1.8.1"
matplotlib = "^3.5.2"
tqdm = "^4.64.0"
ipykernel = "^6.15.0"
ipywidgets = "^8.0.0rc2"
poethepoet = "^0.13.1"
joblib = "^1.2.0"
scikit-learn = { version = "^1.1.1", optional = true }
datasets = { version = "^2.3.2", optional = true, extras = ["torch"] }
[tool.poetry.group.docs]
optional = true
[tool.poetry.group.docs.dependencies]
recommonmark = "^0.7.1"
sphinx = "^5.3.0"
sphinxemoji = "^0.2.0"
sphinxext-opengraph = "^0.4.2"
sphinx-copybutton = "^0.4.0"
sphinx-gitstamp = "^0.3.2"
sphinx-markdown-tables = "^0.0.17"
sphinx-rtd-theme = "^1.0.0"
[tool.poetry.group.lint]
optional = true
[tool.poetry.group.lint.dependencies]
bandit = "^1.7.4"
safety = "^1.10.3"
black = "^22.6.0"
darglint = "^1.8.1"
flake8 = "^4.0.1"
isort = {extras = ["colors"], version = "^5.10.1"}
pre-commit = "^2.19.0"
pylint = "^2.14.1"
pyupgrade = "^2.34.0"
pytest = "^6.2.5"
[tool.poetry.extras]
scikit-learn = ["scikit-learn"]
datasets = ["datasets"]
[tool.poe.tasks]
upgrade-pip = "python -m pip install --upgrade pip"
torch-cpu = "python -m pip install torch==1.12.1+cpu -f https://download.pytorch.org/whl/torch_stable.html"
torch-cuda11 = "python -m pip install torch --extra-index-url https://download.pytorch.org/whl/cu116"
[tool.black]
# https://github.com/psf/black
target-version = ["py38"]
line-length = 119
color = true
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| env
| venv
)/
'''
[tool.isort]
# https://github.com/timothycrosley/isort/
py_version = 38
line_length = 119
known_typing = ["typing", "types", "typing_extensions", "mypy", "mypy_extensions"]
sections = ["FUTURE", "TYPING", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
include_trailing_comma = true
profile = "black"
multi_line_output = 3
indent = 4
color_output = true
lines_after_imports = 2
use_parentheses = true
known_first_party = "inseq"
force_grid_wrap = 0
ensure_newline_before_comments = true
[tool.mypy]
# https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
python_version = 3.8
pretty = true
show_traceback = true
color_output = true
allow_redefinition = false
check_untyped_defs = true
disallow_any_generics = true
disallow_incomplete_defs = true
ignore_missing_imports = true
implicit_reexport = false
no_implicit_optional = true
show_column_numbers = true
show_error_codes = true
show_error_context = true
strict_equality = true
strict_optional = true
warn_no_return = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = 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_gpu"
]
# Extra options:
addopts = [
"--strict-markers",
"--tb=short",
"--doctest-modules",
"--doctest-continue-on-failure",
"--disable-pytest-warnings",
"--color=yes"
]