-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathpyproject.toml
More file actions
134 lines (122 loc) · 3.19 KB
/
Copy pathpyproject.toml
File metadata and controls
134 lines (122 loc) · 3.19 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
[build-system]
requires = ["setuptools>=68.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "dlrouter"
version = "0.1.0"
description = "A high-performance router for large language model inference backends"
readme = "README.md"
license = {text = "Apache-2.0"}
requires-python = ">=3.9"
dependencies = [
"fastapi>=0.100.0",
"uvicorn[standard]>=0.23.0",
"aiohttp>=3.8.0",
"requests>=2.28.0",
"pydantic>=2.0.0",
"numpy>=1.24.0",
"shortuuid>=1.0.0",
"fire>=0.5.0",
"pyyaml>=6.0",
"msgpack>=1.0.0",
"pyzmq>=25.0.0",
]
[project.optional-dependencies]
dlengine = [
"dlslime>=0.1.16",
]
prod = [
"gunicorn>=21.0.0",
]
dev = [
"pytest>=7.0",
"pytest-asyncio>=0.21",
"httpx>=0.24",
"ruff>=0.8.0",
"pre-commit>=3.6.0",
"mypy>=1.8.0",
]
[project.scripts]
dlrouter = "dlrouter.__main__:main"
[tool.setuptools.packages.find]
include = ["dlrouter*"]
# ==================== Ruff ====================
[tool.ruff]
line-length = 120
target-version = "py39"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"I", # isort (import sorting)
"N", # pep8-naming
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"RUF", # ruff-specific rules
"C4", # flake8-comprehensions
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"RSE", # flake8-raise
"RET", # flake8-return
"T20", # flake8-print (disallow print statements)
]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # do not perform function call in argument defaults (FastAPI Depends)
"RET504", # unnecessary assignment before return
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"T20", # allow print in tests
"B011", # allow assert False in tests
]
"dlrouter/gunicorn_conf.py" = [
"T20", # allow print in gunicorn config
]
"dlrouter/__main__.py" = [
"T20", # allow print in CLI entry point
]
[tool.ruff.lint.isort]
known-first-party = ["dlrouter"]
force-single-line = false
lines-after-imports = 2
[tool.ruff.format]
quote-style = "single"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true
docstring-code-line-length = 100
# ==================== Mypy ====================
[tool.mypy]
python_version = "3.10"
warn_return_any = false
warn_unused_configs = true
disallow_untyped_defs = false
check_untyped_defs = true
ignore_missing_imports = true
disable_error_code = ["import-untyped"]
# Per-module overrides for problematic files
[[tool.mypy.overrides]]
module = [
"dlrouter.backends.lmdeploy",
"dlrouter.backends.lmdeploy.*",
"dlrouter.backends.vllm",
"dlrouter.backends.vllm.*",
"dlrouter.backends.factory",
"dlrouter.core.service_discovery.zmq_heartbeat",
"dlrouter.core.health_check",
"dlrouter.core.proxy_engine",
"dlrouter.core.node_manager",
"dlrouter.api.*",
"dlrouter.utils.request_key",
"dlrouter.routing.factory",
]
ignore_errors = true
# ==================== Pytest ====================
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]