-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
138 lines (127 loc) · 3.81 KB
/
pyproject.toml
File metadata and controls
138 lines (127 loc) · 3.81 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
[build-system]
requires = ["setuptools>=78.1.1", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "yolo-toys"
version = "3.2.0"
description = "多模型实时视觉识别系统 - 支持 YOLO、HuggingFace Transformers、多模态模型"
readme = "README.md"
license = "MIT"
requires-python = ">=3.11"
authors = [
{name = "LessUp", email = "lessup@users.noreply.github.com"}
]
keywords = [
"yolo",
"object-detection",
"computer-vision",
"deep-learning",
"fastapi",
"real-time",
"segmentation",
"pose-estimation",
"huggingface",
"transformers",
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Image Recognition",
"Typing :: Typed",
]
dependencies = [
"fastapi~=0.115.0",
"uvicorn[standard]~=0.32.0",
"numpy~=1.26.0",
"opencv-python-headless~=4.9.0",
"pydantic~=2.9.0",
"pydantic-settings~=2.6.0",
"ultralytics>=8.3,<8.5",
"torch>=2.3.0",
"torchvision>=0.18.0",
"transformers~=4.44.0",
"Pillow~=10.4.0",
"cachetools~=5.5.0",
"prometheus-client~=0.21.0",
"python-magic~=0.4.27",
]
[project.optional-dependencies]
dev = [
"pytest~=8.3.0",
"pytest-asyncio~=0.24.0",
"httpx~=0.27.0",
"ruff~=0.7.0",
"basedpyright~=1.31.0",
"pre-commit~=4.0.0",
"pytest-cov~=6.0.0",
"pip-audit~=2.7.0",
"pytest-benchmark>=4.0,<5.3",
]
[project.urls]
Homepage = "https://lessup.github.io/yolo-toys/"
Repository = "https://github.com/LessUp/yolo-toys"
Documentation = "https://lessup.github.io/yolo-toys/docs/"
Issues = "https://github.com/LessUp/yolo-toys/issues"
# Package discovery - only include the app package
[tool.setuptools.packages.find]
include = ["app*"]
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["E", "W", "F", "I", "UP", "B", "SIM", "C4", "FAST", "RUF", "TCH"]
ignore = [
"E501", # line too long (handled by formatter)
"B008", # function call in argument defaults (FastAPI File/Query pattern)
"RUF001", # ambiguous unicode characters in strings (Chinese text)
"RUF002", # ambiguous unicode characters in docstrings (Chinese text)
"RUF003", # ambiguous unicode characters in comments (Chinese text)
]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.pytest.ini_options]
addopts = "-q --cov=app --cov-report=term-missing --cov-report=html"
testpaths = ["tests"]
[tool.coverage.run]
source = ["app"]
branch = true
omit = [
"app/__init__.py",
"app/main.py", # Entry point, hard to test
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
]
fail_under = 15 # Minimum coverage threshold (matches current coverage)
# Basedpyright 类型检查配置
# 参考: https://docs.basedpyright.com/latest/configuration/config-files/
[tool.basedpyright]
# 基础类型检查模式
typeCheckingMode = "standard"
# 排除虚拟环境和缓存目录
exclude = [".venv", "**/__pycache__", "**/node_modules"]
# 将常见警告降级为警告(不阻止 CI)
reportExplicitAny = "warning"
reportUnknownParameterType = "warning"
reportUnknownArgumentType = "warning"
reportUnknownMemberType = "warning"
reportUnknownVariableType = "warning"
reportPrivateUsage = "warning"
reportMissingParameterType = "warning"
reportMissingTypeArgument = "warning"
reportUnusedCallResult = "none"
reportUnknownLambdaType = "none"