-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
196 lines (181 loc) · 3.5 KB
/
pyproject.toml
File metadata and controls
196 lines (181 loc) · 3.5 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
[build-system]
requires = ["uv_build>=0.7.20,<0.8.0"]
build-backend = "uv_build"
[project]
name = "grpo"
version = "0.1.0"
description = 'Group Relative Policy Optimization implementations.'
readme = "README.md"
requires-python = ">=3.10,<=3.12"
license = "MIT"
keywords = []
authors = [
{ name = "Ashwin Mathur", email = "" },
{ name = "Varun Mathur", email = "" },
]
classifiers = [
"License :: OSI Approved :: MIT License",
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
]
dependencies = [
"torch",
"transformers",
"accelerate",
"datasets",
"deepspeed",
"wandb",
]
[dependency-groups]
dev = [
"bandit>=1.9.4",
"mypy>=1.20.0",
"pip-audit>=2.10.0",
"pre-commit>=4.5.1",
"ruff>=0.15.9",
"typos>=1.45.0",
]
[tool.uv]
default-groups = ["dev"]
[project.urls]
Documentation = "https://github.com/avnlp/grpo#readme"
Issues = "https://github.com/avnlp/grpo/issues"
Source = "https://github.com/avnlp/grpo"
[tool.ruff]
line-length = 120
target-version = "py310"
[tool.ruff.lint]
select = [
"A",
"ARG",
"B",
"C",
"D",
"D401",
"DTZ",
"E",
"EM",
"F",
"I",
"ICN",
"ISC",
"N",
"PLC",
"PLE",
"PLR",
"PLW",
"Q",
"RUF",
"S",
"T",
"TID",
"UP",
"W",
"YTT",
]
ignore = [
"ARG001", # Allow unused kwargs in functions
# Allow non-abstract empty methods in abstract base classes
"A002",
"B027",
"B018",
# Allow boolean positional values in function calls, like `dict.get(... True)`
"FBT003",
# Ignore checks for possible passwords
"S101",
"S104",
"S105",
"S106",
"S107",
"S113",
"S701",
# Ignore complexity
"C901",
"PLR2004", # Allow Magic value used in comparison
"PLR0911",
"PLR0912",
"PLR0913",
"PLR0915",
"PLW2901",
"DTZ005",
# Allow print statements
"T201",
# Ignore missing module docstrings
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D107",
"D205",
"D401",
"D417",
# Ignore Line too long
"E501",
"E722",
"E741",
"N802",
"N806",
"N812",
"N816",
]
unfixable = [
# Don't touch unused imports
"F401",
]
extend-select = ["I"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.isort]
known-first-party = ["grpo"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "parents"
[tool.ruff.lint.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]
[tool.mypy]
follow_imports = "skip"
ignore_missing_imports = false
install_types = true
pretty = true
non_interactive = true
namespace_packages = true
explicit_package_bases = true
check_untyped_defs = true
no_implicit_optional = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = false
mypy_path = "src"
[[tool.mypy.overrides]]
module = [
"accelerate.*",
"bottle.*",
"config.*",
"countdown_task.*",
"datasets.*",
"data_types.*",
"deepspeed.*",
"math_verify.*",
"numpy.*",
"optimizer.*",
"qwen2_model.*",
"reward_functions.*",
"tokenizer.*",
"tokenizers.*",
"torch.*",
"transformers.*",
"utils.*",
"vllm.*",
"wandb.*",
]
ignore_missing_imports = true
ignore_errors = true
[[tool.mypy.overrides]]
module = ["grpo.*"]
follow_imports = "skip"
ignore_errors = true
[tool.bandit]
exclude_dirs = ["/.venv", "/build", "/dist"]
skips = ["B101"]