forked from Giskard-AI/giskard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
322 lines (296 loc) Β· 9.12 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
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools.packages.find]
include = ["giskard*"]
exclude = ["docs*", "tests*"]
[tool.setuptools.package-data]
giskard = [
"**/*.md",
"**/*.html",
"**/*.css",
"**/*.js",
"**/*.json",
"**/*titanic.csv",
"**/*prompts.csv",
"**/*.txt",
"**/injection_data/*.csv",
"**/local/*.csv",
]
[tool.pdm.scripts]
_.env = { GSK_DISABLE_ANALYTICS = "True", GISKARD_DEV_MODE = "True" }
# add "-n auto" to the pytest command to parallelize the execution
test.cmd = "pdm base-test tests/"
# for some reason github runners don't work when calling 'pdm test -m "not slow"'
base-test.cmd = "pytest -c pyproject.toml --cov=giskard --cov-report=xml --cov-append --disable-warnings --no-header -vv --durations=0"
test-fast.cmd = "pdm base-test -n auto -m 'not slow' --use-subprocess tests"
test-slow.cmd = "pdm base-test -m 'slow' --use-subprocess"
lint = "ruff check giskard tests"
doc = "sphinx-build docs docs/_build/html"
# -W --keep-going -n => temporary disable
check-doc = "python ./docs/scrapper.py"
watch-doc = "python -m sphinx_autobuild --watch giskard docs docs/_build/html"
clean = "rm -rf coverage.xml coverage* .coverage*"
notebook = "jupyter notebook --ip 0.0.0.0 --port 8888 --no-browser --notebook-dir ./docs/reference/notebooks --NotebookApp.token=''"
check-deps = "deptry ."
update-lock = "docker run --platform linux/amd64 --rm -it -w /work -v ${PWD}/pdm.lock:/work/pdm.lock -v ${PWD}/pyproject.toml:/work/pyproject.toml python:3.10-slim bash -c \"apt update && apt install curl -y && curl -sSL https://pdm.fming.dev/install-pdm.py | python3 - && /root/.local/bin/pdm lock -G :all -v\""
[tool.pdm.dev-dependencies]
dev = [
"typing-extensions",
"jupyter>=1.0.0",
"jupyterlab>=3.4.2",
"pre-commit>=2.19.0",
"mypy>=0.982",
"deptry>=0.5.13",
"ruff>=0.0.271",
"mlflow>2",
"black[d]>=22.12.0",
"pip>=23.1.2",
"pytest-asyncio>=0.21.1",
"pydantic>=2",
"avidtools",
"mistralai>=1",
"boto3>=1.34.88",
"scikit-learn==1.4.2",
]
ml_runtime = [
"langchain>=0.0.275",
"langchain-community",
"nltk>=3.8.1",
"xgboost>=1.7.5",
"lightgbm>=3.3.5",
"imbalanced-learn>=0.12.0",
"catboost>=1.1.1",
"requests-mock>=1.10.0",
"transformers>=4.34.1, <4.43.0",
"sentencepiece", # needed for some transformers stuff with tokenizer
"torch>=2.0.0, < 2.3.0",
"torchdata>=0.6.0, <0.8.0",
"portalocker>=2.0.0", # Needed by torchdata for test_newspaper_classification_pytorch_dataset
"torchtext>=0.15.1, < 1.8",
"mlflow>2,<2.12", # version 2.12 throws error with imbalance-learn
"mlflow-skinny>2,<2.12",
"wandb"
]
test = [
"google.generativeai",
"nemoguardrails>=0.9.0",
"onnxruntime<1.20.0",
"openai>=1",
"polyfactory",
"pytest>=7.1.2",
"pytest-cov>=4.0.0",
"pytest-env>=1.1.0",
"pytest-memray; sys_platform == 'linux' or sys_platform == 'darwin'",
"pytest-reportlog>=0.4.0",
"pytest-xdist>=3.3.1",
"ragas>=0.1.5",
"shap<0.45", # Fixing this to avoid changed on insights
]
doc = [
"furo>=2023.5.20",
"myst-parser>=1.0.0",
"sphinx-autobuild>=2021.3.14",
"sphinx>=6.1.3",
"sphinxcontrib-napoleon>=0.7",
"sphinx-autoapi>=2.1.0",
"sphinx-rtd-theme>=1.2.0",
"sphinx-tabs>=3.4.1",
"sphinx-design>=0.4.1",
"sphinx-copybutton>=0.5.2",
"sphinx-click>=4.4.0",
"nbsphinx>=0.9.2",
"ipython==8.12.0",
"scrapy",
"requests",
]
[project.entry-points."mlflow.model_evaluator"]
giskard = "giskard.integrations.mlflow.giskard_evaluator:GiskardEvaluator"
[project.urls]
"Homepage" = "https://giskard.ai"
"Source Code" = "https://github.com/Giskard-AI/giskard"
"Bug Tracker" = "https://github.com/Giskard-AI/giskard/issues"
"Documentation" = "https://docs.giskard.ai/"
"Discord" = "https://discord.gg/ABvfpbu69R"
"Linkedin" = "https://www.linkedin.com/company/giskard-ai"
"Mastodon" = "https://fosstodon.org/@Giskard"
"Twitter" = "https://twitter.com/giskard_ai"
[project]
name = "giskard"
readme = "README.md"
license = { text = "Apache Software License 2.0" }
version = "2.15.5"
description = "The testing framework dedicated to ML models, from tabular to LLMs"
authors = [{ name = "Giskard AI", email = "[email protected]" }]
keywords = ["Artificial Intelligence", "Machine Learning", "Quality", "MLOps"]
# Pypi classifiers: https://pypi.org/classifiers/
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
requires-python = ">=3.9, <3.13"
dependencies = [
"cloudpickle>=1.1.1",
"zstandard>=0.10.0",
"mlflow-skinny>=2",
"numpy>=1.26.0, <2",
"scikit-learn>=1.0",
"scipy>=1.7.3, <1.12.0",
"mixpanel>=4.4.0",
"requests>=2.19",
"pydantic<3,>1",
"pandas>=2.0",
"xxhash>=3.2.0",
"langdetect>=1.0.9",
"chardet", # text metadata
"jinja2>=3", # scan template
"requests-toolbelt>=0.9.1",
"setuptools", # used for pkg_resources
"typing_extensions", # used in registry/decorators, for python <3.10
"pyyaml",
"packaging", # used in settings
"markdown", # needed for display of scan results in notebook
"colorama", # needed for the scan
"num2words>=0.5.13",
"griffe>=0.36.9, <0.49.0",
]
[project.optional-dependencies]
llm = [
"openai",
"evaluate>=0.4.1",
"bert-score>=0.3.13",
"tenacity>=4.11.0",
"faiss-cpu>=1.7.4, <1.8.0.post1",
"bokeh>=3.3.4, <3.5", # Bokeh >= 3.6 cause issue with rendering plots when saving to html file
"umap-learn>=0.5.5",
"scikit-learn>=1.3.2",
]
talk = [
"openai",
"tenacity>=4.11.0",
"shap<0.44.1,>=0.41.0",
"tabulate==0.9.0",
]
tensorflow = [
"tensorflow-hub>=0.16.0; sys_platform != 'win32' and platform_system !='Windows'",
"tensorflow-macos==2.16.2; sys_platform == 'darwin' and platform_machine == 'arm64'",
"tensorflow==2.16.2",
"tensorflow-text==2.16.1; python_version < '3.11' and (sys_platform == 'linux' or sys_platform == 'darwin') and platform_machine == 'x86_64'",
]
[tool.ruff]
line-length = 120
ignore = ["E501"]
[tool.black]
# https://github.com/psf/black
target-version = ['py39', 'py310', 'py311', 'py312']
line-length = 120
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 = 100
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
[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
show_column_numbers = true
show_error_codes = true
show_error_context = true
plugins = ["pydantic.mypy"]
allow_redefinition = false
check_untyped_defs = false # TODO: Andrey: fix it gradually
disallow_untyped_defs = false # TODO: Andrey: fix it gradually
disallow_any_generics = false # TODO: Andrey: fix it gradually
disallow_incomplete_defs = false # TODO: Andrey: fix it gradually
ignore_missing_imports = true
implicit_reexport = false
no_implicit_optional = false # TODO: Andrey: fix it gradually
strict_equality = false # TODO: Andrey: fix it gradually
strict_optional = false # TODO: Andrey: fix it gradually
warn_no_return = false
warn_redundant_casts = true
warn_return_any = false
warn_unreachable = true
warn_unused_configs = false
warn_unused_ignores = false
[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"]
norecursedirs = [
"hooks",
"*.egg",
".eggs",
"dist",
"build",
"docs",
".tox",
".git",
"__pycache__",
]
doctest_optionflags = [
"ELLIPSIS",
"NUMBER",
"NORMALIZE_WHITESPACE",
"IGNORE_EXCEPTION_DETAIL",
]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"memory_expensive: memory consuming tests",
]
# Extra options:
addopts = [
"--strict-markers",
"--tb=short",
"--doctest-modules",
"--doctest-continue-on-failure",
]
env = ["WANDB_MODE=disabled"]
[tool.deptry]
extend_exclude = [".history"]
ignore_notebooks = true