Skip to content

Commit f0f8a8c

Browse files
committed
chore(deps): reorganize dependencies and update README for installation instructions
1 parent bf9e598 commit f0f8a8c

File tree

3 files changed

+98
-101
lines changed

3 files changed

+98
-101
lines changed

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
<details>
4242
<summary>使用 bump-my-version 工具更新版本号,并触发 Release 工作流 (推荐)</summary>
4343

44-
`bump-my-version` 在 dev 依赖组中,使用 `uv sync --all-groups` 安装,或者使用 `uv tool install bump-my-version` 全局安装
44+
`bump-my-version` `poethepoet` 在 dev 依赖组中,使用 `uv sync` 安装,或者使用 `uv tool install` 全局安装
4545

46-
bump-my-version bump patch
46+
uv run poe bump patch
4747

4848
该操作会有以下行为:
4949
1. 更新 `pyproject.toml``project.version``tool.bumpversion.current_version`
@@ -108,20 +108,25 @@ possible values: major, minor, patch, stable, alpha, beta, rc, post, dev
108108
</details>
109109

110110
> [!NOTE]
111-
> pre-commit 使用方法
111+
> pre-commit / prek 使用方法
112112
113113
<details>
114-
<summary>使用 nonemoji 为 commit message 添加 emoji 前缀 </summary>
115-
116-
安装 `nonemoji`
117-
118-
uv tool install nonemoji
114+
<summary>提交前检查</summary>
119115
安装 `pre-commit`
120116

121117
uv tool install pre-commit
122118

119+
或安装 `prek` (推荐)
120+
121+
Linux / macOS
122+
123+
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/j178/prek/releases/download/v0.2.13/prek-installer.sh | sh
124+
Windows
125+
126+
powershell -ExecutionPolicy ByPass -c "irm https://github.com/j178/prek/releases/download/v0.2.13/prek-installer.ps1 | iex"
127+
安装钩子
128+
123129
pre-commit install
124-
或使用 `prek`
125130

126131
prek install
127132
添加到暂存区
@@ -132,6 +137,5 @@ possible values: major, minor, patch, stable, alpha, beta, rc, post, dev
132137
nonemoji
133138

134139
仓库地址:
135-
- [`nonemoji`](https://github.com/nonebot/nonemoji)
136140
- [`prek`](https://github.com/j178/prek)
137141
</details>

pyproject.toml

Lines changed: 82 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -3,69 +3,54 @@ name = "nonebot-plugin-template"
33
version = "0.1.0"
44
description = "插件描述"
55
readme = "README.md"
6-
authors = [{ name = "owner", email = "[email protected]" }]
76
requires-python = ">=3.10"
7+
authors = [{ name = "owner", email = "[email protected]" }]
88
dependencies = [
9-
"nonebot2>=2.4.3,<3.0.0",
10-
11-
"nonebot-plugin-localstore>=0.7.4,<1.0.0", # 存储文件
12-
"nonebot-plugin-apscheduler>=0.5.0,<1.0.0", # 定时任务
13-
14-
"nonebot-plugin-uninfo>=0.10.0,<1.0.0", # 多平台用户信息获取
15-
"nonebot-plugin-alconna>=0.60.0,<1.0.0", # 跨平台命令解析拓展
169
# "nonebot-adapter-onebot>=2.4.6,<3.0.0"
17-
1810
"httpx>=0.27.0,<1.0.0",
11+
"nonebot-plugin-alconna>=0.60.0,<1.0.0", # 跨平台命令解析拓展
12+
"nonebot-plugin-apscheduler>=0.5.0,<1.0.0", # 定时任务
13+
"nonebot-plugin-localstore>=0.7.4,<1.0.0", # 存储文件
14+
"nonebot-plugin-uninfo>=0.10.0,<1.0.0", # 多平台用户信息获取
15+
"nonebot2>=2.4.3,<3.0.0",
1916
]
2017

2118
[project.urls]
2219
Homepage = "https://github.com/owner/nonebot-plugin-template"
23-
Repository = "https://github.com/owner/nonebot-plugin-template.git"
2420
Issues = "https://github.com/owner/nonebot-plugin-template/issues"
25-
21+
Repository = "https://github.com/owner/nonebot-plugin-template.git"
2622

2723
[dependency-groups]
2824
dev = [
25+
"bump-my-version>=1.2.4",
2926
"nonebot2[fastapi]>=2.4.2,<3.0.0",
27+
"poethepoet>=0.36.0",
3028
"ruff>=0.14.3,<1.0.0",
31-
"bump-my-version>=1.2.4",
3229
]
33-
3430
test = [
35-
"nonebot2[fastapi]>=2.4.2,<3.0.0",
3631
"nonebot-adapter-onebot>=2.4.6,<3.0.0",
32+
"nonebot2[fastapi]>=2.4.2,<3.0.0",
3733
"nonebug>=0.3.7,<1.0.0",
38-
"pytest-xdist>=3.8.0,<4.0.0",
34+
"poethepoet>=0.36.0",
3935
"pytest-asyncio>=1.2.0,<1.3.0",
4036
"pytest-cov>=7.0.0",
41-
"poethepoet>=0.36.0",
37+
"pytest-xdist>=3.8.0,<4.0.0",
4238
]
4339

44-
[tool.uv]
45-
required-version = ">=0.9.0"
46-
default-groups = ["test", "dev"]
47-
48-
[tool.nonebot]
49-
plugins = ["nonebot_plugin_template"]
40+
[build-system]
41+
requires = ["uv_build>=0.9.2,<0.10.0"]
42+
build-backend = "uv_build"
5043

51-
[tool.pytest.ini_options]
52-
asyncio_mode = "auto"
53-
asyncio_default_fixture_loop_scope = "session"
54-
pythonpath = ["src"]
55-
addopts = [
56-
"-v", # 详细输出
57-
"-s", # 显示打印信息
58-
"--tb=short", # 简短的错误回溯
59-
"-ra", # 显示所有测试结果摘要
60-
"--strict-markers", # 严格标记模式
61-
# "--doctest-modules", # 运行文档测试
62-
"--import-mode=prepend", # 导入模式
63-
]
44+
[tool.bumpversion]
45+
current_version = "0.1.0"
46+
commit = true
47+
message = "🔖 release: bump vesion from {current_version} to {new_version}"
48+
tag = true
6449

65-
[tool.poe.tasks]
66-
test = "pytest --cov=src --cov-report xml --junitxml=./junit.xml -n auto"
67-
bump = "bump-my-version bump"
68-
show-bump = "bump-my-version show-bump"
50+
[[tool.bumpversion.files]]
51+
filename = "uv.lock"
52+
search = "name = \"nonebot-plugin-template\"\nversion = \"{current_version}\""
53+
replace = "name = \"nonebot-plugin-template\"\nversion = \"{new_version}\""
6954

7055
[tool.coverage.report]
7156
exclude_lines = [
@@ -75,6 +60,41 @@ exclude_lines = [
7560
"except ImportError:",
7661
]
7762

63+
[tool.nonebot]
64+
plugins = ["nonebot_plugin_template"]
65+
66+
[tool.poe.tasks]
67+
test = "pytest --cov=src --cov-report xml --junitxml=./junit.xml -n auto"
68+
bump = "bump-my-version bump"
69+
show-bump = "bump-my-version show-bump"
70+
71+
[tool.pyright]
72+
pythonVersion = "3.10"
73+
pythonPlatform = "All"
74+
defineConstant = { PYDANTIC_V2 = true }
75+
executionEnvironments = [
76+
{ root = "./tests", extraPaths = [
77+
"./src",
78+
] },
79+
{ root = "./src" },
80+
]
81+
typeCheckingMode = "standard"
82+
disableBytesTypePromotions = true
83+
84+
[tool.pytest.ini_options]
85+
addopts = [
86+
"-v", # 详细输出
87+
"-s", # 显示打印信息
88+
"--tb=short", # 简短的错误回溯
89+
"-ra", # 显示所有测试结果摘要
90+
"--strict-markers", # 严格标记模式
91+
# "--doctest-modules", # 运行文档测试
92+
"--import-mode=prepend", # 导入模式
93+
]
94+
pythonpath = ["src"]
95+
asyncio_mode = "auto"
96+
asyncio_default_fixture_loop_scope = "session"
97+
7898
[tool.ruff]
7999
line-length = 120
80100
target-version = "py310"
@@ -84,33 +104,31 @@ line-ending = "lf"
84104

85105
[tool.ruff.lint]
86106
select = [
87-
"F", # Pyflakes
88-
"W", # pycodestyle warnings
89-
"E", # pycodestyle errors
90-
"I", # isort
91-
"UP", # pyupgrade
92-
"ASYNC", # flake8-async
93-
"C4", # flake8-comprehensions
94-
"T10", # flake8-debugger
95-
"T20", # flake8-print
96-
"PYI", # flake8-pyi
97-
"PT", # flake8-pytest-style
98-
"Q", # flake8-quotes
99-
"TID", # flake8-tidy-imports
100-
"RUF", # Ruff-specific rules
107+
"F", # Pyflakes
108+
"W", # pycodestyle warnings
109+
"E", # pycodestyle errors
110+
"I", # isort
111+
"UP", # pyupgrade
112+
"ASYNC", # flake8-async
113+
"C4", # flake8-comprehensions
114+
"T10", # flake8-debugger
115+
"T20", # flake8-print
116+
"PYI", # flake8-pyi
117+
"PT", # flake8-pytest-style
118+
"Q", # flake8-quotes
119+
"TID", # flake8-tidy-imports
120+
"RUF", # Ruff-specific rules
101121
]
102-
103122
ignore = [
104-
"E402", # module-import-not-at-top-of-file
123+
"E402", # module-import-not-at-top-of-file
105124
"UP037", # quoted-annotation
106-
"RUF001", # ambiguous-unicode-character-string
107-
"RUF002", # ambiguous-unicode-character-docstring
108-
"RUF003", # ambiguous-unicode-character-comment
109-
"W191", # indentation contains tabs
110-
"TID252", # relative import
125+
"RUF001", # ambiguous-unicode-character-string
126+
"RUF002", # ambiguous-unicode-character-docstring
127+
"RUF003", # ambiguous-unicode-character-comment
128+
"W191", # indentation contains tabs
129+
"TID252", # relative import
111130
]
112131

113-
114132
[tool.ruff.lint.isort]
115133
force-sort-within-sections = true
116134
known-first-party = ["tests/*"]
@@ -123,33 +141,6 @@ mark-parentheses = false
123141
[tool.ruff.lint.pyupgrade]
124142
keep-runtime-typing = true
125143

126-
127-
[tool.pyright]
128-
pythonVersion = "3.10"
129-
pythonPlatform = "All"
130-
defineConstant = { PYDANTIC_V2 = true }
131-
executionEnvironments = [
132-
{ root = "./tests", extraPaths = [
133-
"./src",
134-
] },
135-
{ root = "./src" },
136-
]
137-
typeCheckingMode = "standard"
138-
reportShadowedImports = false
139-
disableBytesTypePromotions = true
140-
141-
142-
[build-system]
143-
requires = ["uv_build>=0.9.2,<0.10.0"]
144-
build-backend = "uv_build"
145-
146-
[tool.bumpversion]
147-
current_version = "0.1.0"
148-
commit = true
149-
message = "🔖 release: bump vesion from {current_version} to {new_version}"
150-
tag = true
151-
152-
[[tool.bumpversion.files]]
153-
filename = "uv.lock"
154-
search = "name = \"nonebot-plugin-template\"\nversion = \"{current_version}\""
155-
replace = "name = \"nonebot-plugin-template\"\nversion = \"{new_version}\""
144+
[tool.uv]
145+
required-version = ">=0.9.0"
146+
default-groups = ["test", "dev"]

uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)