-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
170 lines (146 loc) · 3.76 KB
/
pyproject.toml
File metadata and controls
170 lines (146 loc) · 3.76 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
[project]
name = "edgecodedpo"
description = "A toolkit for generating and fine-tuning code models using Direct Preference Optimization (DPO)"
authors = [{ name = "Simon", email = "dubailsimon@gmail.com" }]
readme = "README.md"
classifiers = [
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development",
]
requires-python = ">=3.10"
dynamic = ["version"]
scripts = { edgecodedpo = "edgecodedpo:__main__.app" }
dependencies = [
# Core dependencies
"numpy",
"matplotlib",
"typer",
"tqdm",
"pandas",
"pydantic_settings",
"aiohttp>=3.8.0",
"pathlib",
# Dataset generation
"datasets>=2.14.0",
"openai>=1.0.0",
"huggingface-hub>=0.19.0",
"seaborn",
# DPO training
"torch>=2.0.0",
"transformers>=4.38.0",
"trl>=0.8.1",
"accelerate>=0.27.0",
"bitsandbytes>=0.41.0",
"peft>=0.7.0",
"safetensors>=0.4.0",
"tensorboard>=2.15.0",
"rich>=13.5.0",
"scikit-learn==1.6.1",
"radon==6.0.1",
"pylint==3.3.5",
]
[project.optional-dependencies]
dev = [
"ruff==0.5.*",
"mypy==1.11.*",
"pytest"
]
doc = [
]
# Optional dependencies for specific training setups
# training = [
# "wandb", # For tracking experiments
# "deepspeed>=0.12.0", # For distributed training
# "unsloth>=0.5.0", # For faster LoRA training
# ]
all = ["edgecodedpo[dev]", "edgecodedpo[doc]", "edgecodedpo[training]"]
[tool.ruff]
target-version = "py310"
unsafe-fixes = true
[tool.ruff.lint]
select = [
"E", # pycodestyle
"F", # pyflakes
"UP", # pyupgrade
"I", # isort
"PERF", # Perflint
"S", # flake8-bandit
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"TID", # flake8-tidy-imports
"ICN", # flake8-import-conventions
# "TCH", # flake8-type-checking
"RUF", # Ruff-specific rules
]
ignore = [
"E501", # pycodestyle line too long
"B010", # flake8-bugbear - do not call setattr with a constant attribute value
"RUF012", # Ruff-specific rule - annotated with classvar
"ISC001", # Ruff formatter incompatible
"S608", # flake8-bandit - Possible SQL injection vector through string-based query construction
"B008", # flake8-bugbear - contradict FastAPI
]
[tool.ruff.lint.flake8-import-conventions.aliases]
numpy = "np"
pandas = "pd"
torch = "torch"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all" # Disallow all relative imports.
banned-module-level-imports = ["matplotlib"] # require a lazy import
[tool.ruff.lint.isort]
known-first-party = ["edgecodedpo", "tests"]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.*" = [
"A",
"ARG",
"B",
"BLE",
"C901",
"D",
"DTZ",
"EM",
"FBT",
"G",
"N",
"PGH",
"PIE",
"PLR",
"PLW",
"PTH",
"RSE",
"S",
"S101",
"SIM",
# "TCH",
"TRY",
]
[tool.mypy]
# plugins = ["pydantic.mypy"]
python_version = "3.12"
# Rules can be found at:
# https://mypy.readthedocs.io/en/latest/config_file.html
strict = true
warn_return_any = false
show_error_codes = true
# permissives rules:
implicit_reexport = true # no need to specify __all__ in modules
ignore_missing_imports = true # ignore missing stubs
# follow_imports = "silent" # does not work when using dmypy https://github.com/python/mypy/issues/9475
[[tool.mypy.overrides]]
module = ["tests.*", "docs.*"]
disallow_untyped_defs = false
disallow_untyped_calls = false
disallow_incomplete_defs = false
disallow_untyped_decorators = false
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
# [tool.pyright]
[tool.cruft]
skip = ["edgecodedpo/__init__.py", "tests", "playground"]