Skip to content

Commit

Permalink
chore: 添加 bump version 工具 (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
he0119 authored Aug 7, 2024
1 parent cb7bc6a commit 3ee4180
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 62 deletions.
98 changes: 61 additions & 37 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ version = "0.3.0"
description = "适用于 Nonebot2 的用户插件"
authors = [{ name = "uy_sun", email = "hmy0119@gmail.com" }]
dependencies = [
"nonebot2>=2.2.0",
"nonebot-plugin-orm>=0.7.0",
"nonebot-plugin-alconna>=0.37.1",
"nonebot-plugin-session>=0.3.0",
"expiringdict>=1.2.2",
"nonebot2>=2.2.0",
"nonebot-plugin-orm>=0.7.0",
"nonebot-plugin-alconna>=0.37.1",
"nonebot-plugin-session>=0.3.0",
"expiringdict>=1.2.2",
]
readme = "README.md"
license = { file = "LICENSE" }
Expand Down Expand Up @@ -37,21 +37,24 @@ only-include = ["nonebot_plugin_user"]
managed = true
universal = true
dev-dependencies = [
"nonebug>=0.3.7",
"pytest-cov>=5.0.0",
"pytest-xdist>=3.6.1",
"pytest-mock>=3.14.0",
"pytest-asyncio>=0.23.7",
"freezegun>=1.5.1",
"nonebot2[fastapi,httpx,websockets]>=2.3.2",
"nonebot-plugin-orm[default]>=0.7.4",
"nonebot-adapter-onebot>=2.4.4",
"nonebot-adapter-qq>=1.4.4",
"nonebot-adapter-satori>=0.12.3",
"nonebug>=0.3.7",
"pytest-cov>=5.0.0",
"pytest-xdist>=3.6.1",
"pytest-mock>=3.14.0",
"pytest-asyncio>=0.23.7",
"freezegun>=1.5.1",
"nonebot2[fastapi,httpx,websockets]>=2.3.2",
"nonebot-plugin-orm[default]>=0.7.4",
"nonebot-adapter-onebot>=2.4.4",
"nonebot-adapter-qq>=1.4.4",
"nonebot-adapter-satori>=0.12.3",
"bump-my-version>=0.25.0",
]

[tool.rye.scripts]
test = "pytest --cov=nonebot_plugin_user --cov-report xml -n auto"
bump = "bump-my-version bump"
show-bump = "bump-my-version show-bump"

[tool.pyright]
pythonVersion = "3.9"
Expand All @@ -65,41 +68,62 @@ target-version = "py39"

[tool.ruff.lint]
select = [
"W", # pycodestyle warnings
"E", # pycodestyle errors
"F", # pyflakes
"UP", # pyupgrade
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"T20", # flake8-print
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"W", # pycodestyle warnings
"E", # pycodestyle errors
"F", # pyflakes
"UP", # pyupgrade
"C4", # flake8-comprehensions
"T10", # flake8-debugger
"T20", # flake8-print
"PYI", # flake8-pyi
"PT", # flake8-pytest-style
"Q", # flake8-quotes
]
ignore = [
"E402", # module-import-not-at-top-of-file
"E402", # module-import-not-at-top-of-file
]

[tool.nonebot]
adapters = [
{ name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11" },
{ name = "OneBot V12", module_name = "nonebot.adapters.onebot.v12" },
{ name = "QQ", module_name = "nonebot.adapters.qq" },
{ name = "Satori", module_name = "nonebot.adapters.satori" },
{ name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11" },
{ name = "OneBot V12", module_name = "nonebot.adapters.onebot.v12" },
{ name = "QQ", module_name = "nonebot.adapters.qq" },
{ name = "Satori", module_name = "nonebot.adapters.satori" },
]
plugins = ["nonebot_plugin_user"]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@overload",
"except ImportError:",
"pragma: no cover",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@overload",
"except ImportError:",
]
omit = ["*/migrations/*"]

[tool.pytest.ini_options]
addopts = ["--import-mode=importlib"]
asyncio_mode = "auto"

[tool.bumpversion]
current_version = "0.3.0"
commit = true
message = "chore(release): {new_version}"

[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = "version = \"{current_version}\""
replace = "version = \"{new_version}\""

[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
search = "[Unreleased]"
replace = "[Unreleased]\n\n## [{new_version}] - {now:%Y-%m-%d}"

[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
regex = true
search = "\\[unreleased\\]: (https://.+?)v{current_version}\\.\\.\\.HEAD"
replace = "[unreleased]: \\1v{new_version}...HEAD\n[{new_version}]: \\1v{current_version}...v{new_version}"
43 changes: 26 additions & 17 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ asgiref==3.8.1
# via nonebug
async-asgi-testclient==1.4.11
# via nonebug
bracex==2.5
# via wcmatch
bump-my-version==0.25.0
certifi==2024.7.4
# via httpcore
# via httpx
# via requests
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via bump-my-version
# via nonebot-plugin-orm
# via rich-click
# via typer
# via uvicorn
colorama==0.4.6 ; platform_system == 'Windows' or sys_platform == 'win32'
Expand All @@ -50,9 +55,6 @@ dnspython==2.6.1
# via email-validator
email-validator==2.2.0
# via fastapi
exceptiongroup==1.2.1 ; python_version < '3.11'
# via anyio
# via pytest
execnet==2.1.1
# via pytest-xdist
expiringdict==1.2.2
Expand Down Expand Up @@ -88,9 +90,6 @@ idna==3.7
# via yarl
importlib-metadata==7.2.1
# via nonebot-plugin-alconna
# via nonebot-plugin-orm
importlib-resources==6.4.0 ; python_version < '3.12'
# via nonebot-plugin-orm
iniconfig==2.0.0
# via pytest
jinja2==3.1.4
Expand Down Expand Up @@ -146,14 +145,20 @@ packaging==24.1
# via pytest
pluggy==1.5.0
# via pytest
prompt-toolkit==3.0.36
# via questionary
pydantic==2.8.2
# via bump-my-version
# via fastapi
# via nonebot-adapter-onebot
# via nonebot-adapter-qq
# via nonebot-plugin-localstore
# via nonebot2
# via pydantic-settings
pydantic-core==2.20.1
# via pydantic
pydantic-settings==2.4.0
# via bump-my-version
pygments==2.18.0
# via rich
pygtrie==2.5.0
Expand All @@ -172,15 +177,22 @@ python-dateutil==2.9.0.post0
# via freezegun
python-dotenv==1.0.1
# via nonebot2
# via pydantic-settings
# via uvicorn
python-multipart==0.0.9
# via fastapi
pyyaml==6.0.1
# via uvicorn
questionary==2.0.1
# via bump-my-version
requests==2.32.3
# via async-asgi-testclient
rich==13.7.1
# via bump-my-version
# via rich-click
# via typer
rich-click==1.8.3
# via bump-my-version
shellingham==1.5.4
# via typer
six==1.16.0
Expand All @@ -199,44 +211,42 @@ tarina==0.5.4
# via arclet-alconna
# via nepattern
# via nonebot-plugin-alconna
tomli==2.0.1 ; python_full_version <= '3.11.0a6' or python_version < '3.11'
# via coverage
# via nonebot2
# via pytest
tomlkit==0.13.0
# via bump-my-version
typer==0.12.3
# via fastapi-cli
typing-extensions==4.12.2
# via aiosqlite
# via alembic
# via anyio
# via arclet-alconna
# via asgiref
# via fastapi
# via nepattern
# via nonebot-adapter-onebot
# via nonebot-adapter-qq
# via nonebot-plugin-localstore
# via nonebot-plugin-orm
# via nonebot2
# via nonebug
# via pydantic
# via pydantic-core
# via rich-click
# via sqlalchemy
# via starlette
# via tarina
# via typer
# via uvicorn
ujson==5.10.0
# via fastapi
urllib3==2.2.2
# via requests
uvicorn==0.30.1
# via fastapi
# via nonebot2
uvloop==0.19.0 ; sys_platform != 'win32' and (platform_python_implementation != 'PyPy' and sys_platform != 'cygwin')
uvloop==0.19.0 ; platform_python_implementation != 'PyPy' and sys_platform != 'cygwin' and sys_platform != 'win32'
# via uvicorn
watchfiles==0.22.0
# via uvicorn
wcmatch==9.0
# via bump-my-version
wcwidth==0.2.13
# via prompt-toolkit
websockets==12.0
# via nonebot2
# via uvicorn
Expand All @@ -247,4 +257,3 @@ yarl==1.9.4
# via nonebot2
zipp==3.19.2
# via importlib-metadata
# via importlib-resources
9 changes: 1 addition & 8 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@ colorama==0.4.6 ; platform_system == 'Windows' or sys_platform == 'win32'
# via loguru
expiringdict==1.2.2
# via nonebot-plugin-user
greenlet==3.0.3 ; python_version < '3.13' and (platform_machine == 'aarch64' or (platform_machine == 'ppc64le' or (platform_machine == 'x86_64' or (platform_machine == 'amd64' or (platform_machine == 'AMD64' or (platform_machine == 'WIN32' or platform_machine == 'win32'))))))
greenlet==3.0.3 ; python_version < '3.13' and (platform_machine == 'AMD64' or platform_machine == 'WIN32' or platform_machine == 'aarch64' or platform_machine == 'amd64' or platform_machine == 'ppc64le' or platform_machine == 'win32' or platform_machine == 'x86_64')
# via sqlalchemy
idna==3.7
# via yarl
importlib-metadata==7.2.1
# via nonebot-plugin-alconna
# via nonebot-plugin-orm
importlib-resources==6.4.0 ; python_version < '3.12'
# via nonebot-plugin-orm
loguru==0.7.2
# via nonebot2
mako==1.3.5
Expand Down Expand Up @@ -82,14 +79,11 @@ tarina==0.5.4
# via arclet-alconna
# via nepattern
# via nonebot-plugin-alconna
tomli==2.0.1 ; python_version < '3.11'
# via nonebot2
typing-extensions==4.12.2
# via alembic
# via arclet-alconna
# via nepattern
# via nonebot-plugin-localstore
# via nonebot-plugin-orm
# via nonebot2
# via pydantic
# via pydantic-core
Expand All @@ -101,4 +95,3 @@ yarl==1.9.4
# via nonebot2
zipp==3.19.2
# via importlib-metadata
# via importlib-resources

0 comments on commit 3ee4180

Please sign in to comment.