-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
232 lines (216 loc) · 7.65 KB
/
pyproject.toml
File metadata and controls
232 lines (216 loc) · 7.65 KB
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
[project]
name = "pyine"
version = "1.0.0"
readme = "README.md"
description = "Python Interpretation and Execution (PyINE) framework"
keywords = ["benchmarking", "python", "interpretation", "execution", "llm", "nlp"]
authors = [
{ name = "Pierre-Luc St-Charles", email = "pl.stcharles@lawzero.org" },
{ name = "Alessandro Palmas", email = "a.palmas@lawzero.org" }
]
license = "Apache-2.0"
requires-python = ">=3.12,<3.13"
dependencies = [
# last review/update of versions: 2025-08-23
"accelerate>=1.10.0,<2.0.0",
"backoff>=2.2.1,<3.0.0",
"blobfile>=3.0.0,<4.0.0",
"datasets>=4.0.0,<5.0.0",
"deepdiff>=8.6.0,<9.0.0",
"deepspeed>=0.18.3",
"evaluate>=0.4.5,<1.0.0",
"filelock>=3.20.0,<4.0.0",
"gitpython>=3.1.45,<4.0.0",
"hydra-colorlog>=1.2.0,<2.0.0",
"hydra-core>=1.3.2,<1.4.0",
"hydra-joblib-launcher>=1.2.0,<2.0.0",
"hydra-wandb-sweeper @ git+https://github.com/plstcharles-saifh/hydra-wandb-sweeper.git@0.0.6",
"hydra-zen>=0.16.0,<1.0.0",
"ipykernel>=7.1.0",
"ipython>=8.37.0",
"langchain-huggingface>=0.3.1,<1.0.0",
"langchain>=0.3.27,<0.4.0",
"langchain_deepseek>=0.1.4,<0.2.0",
"langgraph>=0.3,<1.0",
"Levenshtein>=0.27.1,<0.28.0",
"lightning>=2.5.3,<2.6.0",
"lmdb>=1.7.3,<2.0.0",
"lz4>=4.4.4,<5.0.0",
"matplotlib>=3.10.5,<4.0.0",
"msgspec>=0.19.0,<0.20.0",
"numpy<2.3.0",
"openai>=1.101.0,<2.0.0",
"orjson>=3.11.2,<3.12.0",
"pandas-stubs~=2.3.3",
"pandas>=2.3.2,<3.0.0",
"peft>=0.17.1,<1.0.0",
"pydantic>=2.11.7,<3.0.0",
"pyright>=1.1.408",
"python-dotenv>=1.1.1,<2.0.0",
"python-minifier>=2.11.3,<3.0.0",
"radon>=6.0.1",
"rich>=14.1.0,<15.0.0",
"ruff>=0.13.2,<1.0.0",
"scikit-learn>=1.8.0",
"scikit-learn>=1.8.0,<2.0.0",
"scipy-stubs~=1.17.1",
"scipy>=1.17.1,<2.0.0",
"tensorboard>=2.20.0",
"tiktoken>=0.11.0,<1.0.0",
"torch>=2.8.0,<3.0.0",
"tqdm>=4.67.1,<5.0.0",
"transformers>=4.55.4,<5.0.0",
"trl>=0.27.1",
"unidiff>=0.7.5,<0.8.0",
"wandb>=0.25.1,<1.0.0",
]
[project.optional-dependencies]
dev = [
"adjusttext>=1.3.0",
"coverage[toml]>=7.10.0",
"ipython>=8.0.0,<9.0.0",
"ipywidgets>=8.1.0,<9.0.0",
"nbstripout>=0.8.0,<1.0.0",
"notebook>=7.3.0,<8.0.0",
"pre-commit>=4.3.0,<5.0.0",
"pyright[nodejs]>=1.1.408",
"pytest-asyncio>=1.1.0",
"pytest-cov>=6.2.0",
"pytest-mock>=3.14",
"pytest-timeout>=2.4.0",
"pytest>=8.0.0",
"seaborn>=0.13.2",
"wordcloud>=1.9.4",
]
vllm = [
"trl[vllm]>=0.27.1; sys_platform != 'darwin'", # can't install vLLM on MacOS
]
flash_attn = [
"flash-attn>=2.8.3; sys_platform == 'linux'", # CUDA-only, Linux
]
liger = [
"liger-kernel>=0.6.4; sys_platform == 'linux'", # CUDA-only, Linux
]
gpu_monitoring = [
"nvidia-ml-py>=13.590.0; sys_platform == 'linux'", # NVML bindings for GPU stats
]
[build-system]
requires = ["setuptools>=42", "wheel"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
packages = ["pyine"]
[tool.setuptools.package-data]
"pyine" = ["**/*.yaml"]
[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
"slow: marks tests as slow to run due to data/compute (deselect with '-m \"not slow\"')",
"integration: marks end-to-end or cross-service tests that rely on external resources/APIs (deselect with '-m \"not integration\"')",
"dataset: marks tests that require large local datasets (e.g. TACO) to be present (deselect with '-m \"not dataset\"')",
"openai: marks tests that exercise the live OpenAI API and require network access plus OPENAI_API_KEY (deselect with '-m \"not openai\"')",
"distributed: marks tests that require distributed/multi-process execution (deselect with '-m \"not distributed\"')",
]
filterwarnings = [
# until hydra-zen fixes their pydantic v1 warnings, we need this (currently using 0.15.0)
'ignore:The `__fields__` attribute is deprecated, use the `model_fields` class property instead\.:pydantic.warnings.PydanticDeprecatedSince20:hydra_zen\.structured_configs\._implementations',
'ignore:.*hydra-zen.*pydantic v1.*:UserWarning',
'ignore:.*:pydantic.warnings.UnsupportedFieldAttributeWarning',
# pytorch 2.9+ deprecation warnings triggered by internal/dependency code
'ignore:.*allow_tf32.*will be deprecated after Pytorch 2\.9.*:UserWarning',
'ignore:.*pin_memory.*is deprecated.*:DeprecationWarning',
'ignore:.*is_pinned.*is deprecated.*:DeprecationWarning',
# SWIG deprecation warnings from dependencies
'ignore:builtin type SwigPyPacked has no __module__ attribute:DeprecationWarning',
'ignore:builtin type SwigPyObject has no __module__ attribute:DeprecationWarning',
]
[tool.coverage.run]
branch = true
parallel = true
relative_files = true
source = ["pyine"]
data_file = "logs/coverage/.coverage"
omit = [
"tests/*",
"**/__init__.py",
]
[tool.coverage.report]
skip_covered = true
show_missing = true
exclude_lines = [
"pragma: no cover",
'if __name__ == "__main__":',
"raise NotImplementedError",
"if typing.TYPE_CHECKING:",
]
[tool.coverage.html]
directory = "logs/coverage/html"
[tool.coverage.xml]
output = "logs/coverage/coverage.xml"
# Legacy tool configs kept for nbqa compatibility
[tool.isort]
profile = "black"
line_length = 120
src_paths = ["pyine", "tests"]
known_first_party = ["pyine", "tests"]
[tool.nbqa]
files = "^notebooks/"
[tool.nbqa.addopts]
ruff = ["--line-length=120"]
ruff-format = ["--line-length=120"]
[tool.ruff]
line-length = 120
indent-width = 4
[tool.ruff.lint]
select = [
# Core linting
"E", # pycodestyle errors (spacing, indentation, etc.)
"F", # pyflakes (unused imports, variables, etc.)
"W", # pycodestyle warnings
# Code quality
"I", # isort (import sorting and organization)
"B", # flake8-bugbear (common bugs and design problems)
"C4", # flake8-comprehensions (mccabe; better list/dict comprehensions)
"UP", # pyupgrade (modern Python syntax)
"RUF008", # mutable-dataclass-default
"RUF012", # mutable-class-default
# Type annotations
"ANN", # flake8-annotations (enforce type hints)
"TC", # flake8-type-checking (type-checking imports)
# Security and best practices
"S", # flake8-bandit (security issues)
"N", # pep8-naming (naming conventions)
"RET", # flake8-return (return statement issues)
"SIM", # flake8-simplify (code simplification)
]
ignore = [
# Type annotation exceptions
"ANN401", # any-type (typing.Any allowed in framework)
# Security exceptions for common patterns
"S101", # assert (use of assert is allowed in framework, common in tests)
"S603", # subprocess-without-shell-equal...
"S311", # suspicious-non-cryptographic-....
# Code unreadability
"SIM102", # collapsible-if (allow nested `if`)
"SIM108", # if-else-block-instead-of-... (allow ternary operator)
]
[tool.ruff.lint.isort]
known-third-party = ["wandb"]
[tool.ruff.format]
# Formatting style - matching Black formatting
indent-style = "space"
quote-style = "preserve" # Don't enforce single vs double quotes
docstring-code-format = true # Format code blocks in docstrings
skip-magic-trailing-comma = false # Keep Black's trailing comma behavior
line-ending = "auto" # Use system default line endings
[tool.uv.extra-build-dependencies]
flash-attn = ["torch"]
[tool.pyright]
typeCheckingMode = "strict"
include = ["pyine"]
exclude = ["tests"]
venvPath = "."
venv = ".venv"
# Overrides from strict defaults for data science workflows
reportMissingTypeStubs = false # Ignore missing third-party type stubs
reportOptionalMemberAccess = false # Allow optional member access (e.g., df.column)
reportOptionalSubscript = false # Allow optional subscript access without None checks