-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathpyproject.toml
More file actions
202 lines (181 loc) · 5.72 KB
/
Copy pathpyproject.toml
File metadata and controls
202 lines (181 loc) · 5.72 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
# Copyright 2026 FlagOS Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
[build-system]
requires = [
"setuptools>=77.0.3,<81.0.0",
"setuptools-scm>=8.0",
"torch>=2.7.1",
"wheel",
"scikit-build-core==0.11",
"pybind11",
"ninja",
"cmake",
]
build-backend = "setuptools.build_meta"
[project]
name = "vllm-plugin-fl"
dynamic = ["version"]
description = "A vLLM plugin built on the FlagOS unified multi-chip backend"
license = "Apache-2.0"
license-files = ["LICENSE"]
readme = "README.md"
requires-python = ">=3.10,<3.14"
classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Information Analysis",
]
dependencies = [
"pyyaml",
]
[project.entry-points."vllm.platform_plugins"]
fl = "vllm_fl:register"
[project.entry-points."vllm.general_plugins"]
fl = "vllm_fl:register_model"
[project.urls]
Homepage = "https://github.com/flagos-ai/vllm-plugin-FL"
[project.optional-dependencies]
test = [
"pytest",
"pytest-cov",
"pytest-timeout",
"pytest-json-report",
"numpy",
"requests",
"openai",
"pillow",
"decorator",
"vllm[audio]==0.20.2",
"modelscope>=1.18.1",
]
[tool.setuptools_scm]
# Generate a static `_version.py` at build time so the installed package
# never needs to run `git` at import time (same pattern as vLLM/PyTorch).
# The template extracts commit sha and date from the version string and
# exposes them as `git_version`, `git_date`, and `git_info`.
write_to = "vllm_fl/_version.py"
# Keep the public version at the nearest tag without appending `.devN`.
version_scheme = "only-version"
write_to_template = '''# This file is generated by setuptools-scm at build time. Do not edit.
# At runtime vllm_fl/version.py imports git_version and git_date from here.
from __future__ import annotations
import re as _re
__version__: str = "{version}"
version: str = __version__
_node_date: str = "{scm_version.node_date}"
_sha_m = _re.search(r"(?:^|[.+-])g(?P<sha>[0-9a-f]{{7,40}})(?:[.+-]|$)", __version__)
_date_m = _re.search(r"(?:^|[.+-])d(?P<ymd>\d{{8}})(?:[.+-]|$)", __version__)
git_version: str = _sha_m.group("sha") if _sha_m else "Unknown"
git_date: str = (
_node_date if _node_date not in ("", "None")
else (
_date_m.group("ymd")[0:4] + "-" + _date_m.group("ymd")[4:6] + "-" + _date_m.group("ymd")[6:8]
if _date_m else "Unknown"
)
)
git_info: dict[str, str] = {{"id": git_version, "date": git_date}}
'''
# Include commit date in the local version string so the template can parse it.
local_scheme = "node-and-date"
fallback_version = "0.0.0"
[tool.setuptools.packages.find]
where = ["."]
include = ["vllm_fl*"]
[tool.setuptools.package-data]
"vllm_fl.dispatch.config" = ["*.yaml"]
[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"gpu: marks tests as requiring single GPU (deselect with '-m \"not gpu\"')",
"multi_gpu: marks tests as requiring multiple GPUs",
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"e2e: marks tests as end-to-end tests",
"flaggems: marks tests as requiring flag_gems library",
"functional: marks tests as functional tests",
]
addopts = "-v --tb=short"
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::UserWarning",
]
[tool.coverage.run]
source = ["vllm_fl"]
omit = [
"tests/*",
"examples/*",
"benchmarks/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if TYPE_CHECKING:",
"if __name__ == .__main__.:",
]
[tool.ruff]
exclude = [
"vllm_fl/**",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"UP", # pyupgrade
"B", # flake8-bugbear
"ISC", # flake8-implicit-str-concat
"SIM", # flake8-simplify
"I", # isort
"G", # flake8-logging-format
]
ignore = [
"E501", # line too long (handled by formatter)
"E731", # lambda expression assignment
"E402", # Module level import not at top of file
"E722", # Use bare except, specify exception instead
"E731", # lambda assignment
"E741", # Use variables named 'l', 'O', or 'I'
"F405", # star imports
"F403", # star imports
"B008", # do not perform function calls in argument defaults
"B905", # zip without `strict=`
"B007", # Loop control variable not used within loop body
"UP015", # Explicit is better than implicit" rule
"UP032", # f-string format
"G004", # logging f-string
]
[tool.ruff.lint.isort]
combine-as-imports = true
known-first-party = ["vllm"]
known-local-folder = ["vllm_fl"]
[tool.ruff.format]
docstring-code-format = true
[tool.typos.files]
# these files may be written in non english words
extend-exclude = ["tests/**", "vllm_fl/**"]
ignore-hidden = true
ignore-files = true
ignore-dot = true
ignore-vcs = true
ignore-global = true
ignore-parent = true