Skip to content

Commit

Permalink
chore: 添加 bump version 工具 (#325)
Browse files Browse the repository at this point in the history
chore: 添加 bump version 工具
  • Loading branch information
he0119 authored Aug 15, 2024
1 parent 5a17c72 commit 18eae62
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 47 deletions.
115 changes: 69 additions & 46 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ version = "0.7.3"
description = "适用于 NoneBot2 的词云插件"
authors = [{ name = "uy_sun", email = "[email protected]" }]
dependencies = [
"nonebot2[fastapi]>=2.2.0",
"nonebot-plugin-apscheduler>=0.4.0",
"nonebot-plugin-localstore>=0.6.0",
"nonebot-plugin-orm>=0.7.0",
"nonebot-plugin-alconna>=0.49.0",
"nonebot-plugin-cesaa>=0.4.0",
"wordcloud>=1.8.1",
"jieba>=0.42.1",
"tzdata",
"emoji>=1.6.3",
"nonebot2[fastapi]>=2.2.0",
"nonebot-plugin-apscheduler>=0.4.0",
"nonebot-plugin-localstore>=0.6.0",
"nonebot-plugin-orm>=0.7.0",
"nonebot-plugin-alconna>=0.49.0",
"nonebot-plugin-cesaa>=0.4.0",
"wordcloud>=1.8.1",
"jieba>=0.42.1",
"tzdata",
"emoji>=1.6.3",
]
readme = "README.md"
license = { file = "LICENSE" }
Expand Down Expand Up @@ -45,27 +45,30 @@ only-include = ["nonebot_plugin_wordcloud"]
managed = true
universal = true
dev-dependencies = [
"nb-cli>=1.4.1",
"nonebug>=0.3.7",
"nonebug-saa>=0.4.1",
"nonebot-adapter-onebot>=2.4.4",
"nonebot-plugin-orm[default]>=0.7.4",
"nonebot-plugin-datastore>=1.3.0",
"asyncpg>=0.29.0",
"aiomysql>=0.2.0",
"pytest-cov>=5.0.0",
"pytest-xdist>=3.6.1",
"pytest-mock>=3.14.0",
"pytest-asyncio>=0.23.7",
"respx>=0.21.1",
"httpx>=0.27.0",
"gevent>=24.2.1",
"cryptography>=42.0.8",
"nb-cli>=1.4.1",
"nonebug>=0.3.7",
"nonebug-saa>=0.4.1",
"nonebot-adapter-onebot>=2.4.4",
"nonebot-plugin-orm[default]>=0.7.4",
"nonebot-plugin-datastore>=1.3.0",
"asyncpg>=0.29.0",
"aiomysql>=0.2.0",
"pytest-cov>=5.0.0",
"pytest-xdist>=3.6.1",
"pytest-mock>=3.14.0",
"pytest-asyncio>=0.23.7",
"respx>=0.21.1",
"httpx>=0.27.0",
"gevent>=24.2.1",
"cryptography>=42.0.8",
"bump-my-version>=0.25.4",
]

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

[tool.pyright]
pythonVersion = "3.9"
Expand All @@ -79,26 +82,26 @@ 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]
plugins = ["nonebot_plugin_wordcloud"]
adapters = [
{ name = "OneBot V12", module_name = "nonebot.adapters.onebot.v12", project_link = "nonebot-adapter-onebot", desc = "OneBot V12 协议" },
{ name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11", project_link = "nonebot-adapter-onebot", desc = "OneBot V11 协议" },
{ name = "OneBot V12", module_name = "nonebot.adapters.onebot.v12", project_link = "nonebot-adapter-onebot", desc = "OneBot V12 协议" },
{ name = "OneBot V11", module_name = "nonebot.adapters.onebot.v11", project_link = "nonebot-adapter-onebot", desc = "OneBot V11 协议" },
]

[tool.coverage.run]
Expand All @@ -107,16 +110,36 @@ concurrency = ["thread", "gevent"]

[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 = ["*/compat.py", "*/migrations/*"]


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

[tool.bumpversion]
current_version = "0.7.3"
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}"
23 changes: 22 additions & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ async-asgi-testclient==1.4.11
asyncpg==0.29.0
binaryornot==0.4.4
# via cookiecutter
bracex==2.5
# via wcmatch
bump-my-version==0.25.4
cashews==7.2.0
# via nb-cli
certifi==2024.7.4
Expand All @@ -54,9 +57,11 @@ chardet==5.2.0
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via bump-my-version
# via cookiecutter
# via nb-cli
# via nonebot-plugin-orm
# via rich-click
# via uvicorn
colorama==0.4.6 ; platform_system == 'Windows' or sys_platform == 'win32'
# via click
Expand Down Expand Up @@ -210,20 +215,25 @@ platformdirs==4.2.2
# via virtualenv
pluggy==1.5.0
# via pytest
prompt-toolkit==3.0.47
prompt-toolkit==3.0.36
# via noneprompt
# via questionary
pycparser==2.22 ; platform_python_implementation != 'PyPy' or (platform_python_implementation == 'CPython' and sys_platform == 'win32')
# via cffi
pydantic==2.8.2
# via bump-my-version
# via fastapi
# via nb-cli
# via nonebot-adapter-onebot
# via nonebot-plugin-apscheduler
# via nonebot-plugin-localstore
# via nonebot-plugin-send-anything-anywhere
# via nonebot2
# via pydantic-settings
pydantic-core==2.20.1
# via pydantic
pydantic-settings==2.4.0
# via bump-my-version
pyfiglet==1.0.2
# via nb-cli
pygments==2.18.0
Expand All @@ -250,6 +260,7 @@ python-dateutil==2.9.0.post0
# via matplotlib
python-dotenv==1.0.1
# via nonebot2
# via pydantic-settings
# via uvicorn
python-slugify==8.0.4
# via cookiecutter
Expand All @@ -258,12 +269,18 @@ pytz==2024.1
pyyaml==6.0.2
# via cookiecutter
# via uvicorn
questionary==2.0.1
# via bump-my-version
requests==2.32.3
# via async-asgi-testclient
# via cookiecutter
respx==0.21.1
rich==13.7.1
# via bump-my-version
# via cookiecutter
# via rich-click
rich-click==1.8.3
# via bump-my-version
setuptools==72.2.0
# via zope-event
# via zope-interface
Expand All @@ -289,6 +306,7 @@ tarina==0.5.5
text-unidecode==1.3
# via python-slugify
tomlkit==0.13.2
# via bump-my-version
# via nb-cli
types-python-dateutil==2.9.0.20240316
# via arrow
Expand All @@ -306,6 +324,7 @@ typing-extensions==4.12.2
# via nonebug
# via pydantic
# via pydantic-core
# via rich-click
# via sqlalchemy
# via tarina
tzdata==2024.1
Expand All @@ -324,6 +343,8 @@ virtualenv==20.26.3
watchfiles==0.23.0
# via nb-cli
# via uvicorn
wcmatch==9.0
# via bump-my-version
wcwidth==0.2.13
# via nb-cli
# via prompt-toolkit
Expand Down

0 comments on commit 18eae62

Please sign in to comment.