Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
93 lines (81 loc) · 2.36 KB
/
Copy pathpyproject.toml
File metadata and controls
93 lines (81 loc) · 2.36 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
[project.urls]
Homepage = "https://github.com/shibeta/JNTMbot_python"
Repository = "https://github.com/shibeta/JNTMbot_python.git"
"Bug Tracker" = "https://github.com/shibeta/JNTMbot_python/issues"
[project]
name = "JNTMbot_python"
version = "1.5.2"
description = "德瑞Bot自动开车脚本"
readme = "README.md"
requires-python = ">=3.12"
license = { text = "MIT" }
dependencies = [
"colorlog",
"comtypes",
"numpy",
"Pillow",
"psutil",
"pynput",
"pywin32",
"requests",
"ruamel.yaml",
"uiautomation",
"vgamepad",
]
[project.optional-dependencies]
dev = [
"pip-tools", # 用于导出 txt 依赖树
"pyinstaller", # 打包工具
"pyinstaller-versionfile", # 生成 exe 版本信息
"ruff", # 格式化与检查
"mypy", # 类型检查
"pytest", # 测试框架
"pytest-cov", # 测试覆盖率
]
[build-system]
# 暂时没用用处,因为不需要发包
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = [] # 不进行常规的 Python 源码打包
[tool.hatch.build.targets.sdist]
include = []
[tool.ruff]
target-version = "py312"
line-length = 120
extend-exclude = ["venv", "build", "dist", "RapidOCR_api.py"]
[tool.ruff.lint]
select = ["E", "F", "W", "I", "UP", "B", "SIM", "RUF", "PIE"]
ignore = [
"E501", # 忽略长行
"RUF001",
"RUF002",
"RUF003", # 忽略中文标点
"UP006",
"UP035",
"UP045", # 忽略类型注解
]
[tool.ruff.lint.per-file-ignores]
# main.py 需要在导入前初始化 lifecycle manager
"main.py" = ["E402"]
[tool.ruff.format]
# 不格式化外部引入库
exclude = ["RapidOCR_api.py"]
[tool.mypy]
python_version = "3.12"
files = ["."]
# vgamepad / comtypes / pywin32 / pynput 没有类型存根
ignore_missing_imports = true
# 不检查外部引入库, Node.js 项目和单元测试代码
# TODO: 将ai生成的单元测试正规化
exclude = ['RapidOCR_api.py$', "steam_bot/", "tests/"]
exclude_gitignore = true
check_untyped_defs = false
[tool.pytest.ini_options]
testpaths = ["tests"]
# addopts = "-q"
pythonpath = ["."]
[tool.coverage.run]
# 没有包所以指定扫描所有文件,通过 omit 忽略不需要扫描的文件夹和文件
source = ["."]
omit = ["venv/*", "build/*", "dist/*", "steam_bot/*", "tests/*"]