🔀 Merge branch dev

This commit is contained in:
yanyongyu 2022-01-15 22:12:50 +08:00
commit b7a0ba11d5
25 changed files with 195 additions and 79 deletions

View File

@ -1,36 +1,36 @@
name-template: 'Release v$RESOLVED_VERSION 🌈' name-template: "Release v$RESOLVED_VERSION 🌈"
tag-template: 'v$RESOLVED_VERSION' tag-template: "v$RESOLVED_VERSION"
categories: categories:
- title: '💥 Breaking Changes' - title: "💥 Breaking Changes"
labels: labels:
- 'Breaking' - "Breaking"
- title: '🚀 Features' - title: "🚀 Features"
labels: labels:
- 'feature' - "feature"
- 'enhancement' - "enhancement"
- title: '🐛 Bug Fixes' - title: "🐛 Bug Fixes"
labels: labels:
- 'fix' - "fix"
- 'bugfix' - "bugfix"
- 'bug' - "bug"
- title: '🍻 Plugin Publish' - title: "🍻 Plugin Publish"
label: 'Plugin' label: "Plugin"
- title: '🍻 Bot Publish' - title: "🍻 Bot Publish"
label: 'Bot' label: "Bot"
- title: '🍻 Adapter Publish' - title: "🍻 Adapter Publish"
label: 'Adapter' label: "Adapter"
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
version-resolver: version-resolver:
major: major:
labels: labels:
- 'major' - "major"
minor: minor:
labels: labels:
- 'minor' - "minor"
patch: patch:
labels: labels:
- 'patch' - "patch"
default: patch default: patch
template: | template: |
## Documentation ## Documentation

View File

@ -48,10 +48,10 @@ jobs:
- name: Deploy to Netlify - name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1 uses: nwtgck/actions-netlify@v1
with: with:
publish-dir: './website/build' publish-dir: "./website/build"
production-deploy: ${{ env.PRODUCTION }} production-deploy: ${{ env.PRODUCTION }}
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message: 'Deploy ${{ env.DEPLOY_NAME }}@${{ github.sha }}' deploy-message: "Deploy ${{ env.DEPLOY_NAME }}@${{ github.sha }}"
enable-commit-comment: false enable-commit-comment: false
alias: ${{ env.DEPLOY_NAME }} alias: ${{ env.DEPLOY_NAME }}
env: env:

20
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,20 @@
ci:
autofix_commit_msg: ":rotating_light: auto fix by pre-commit hooks"
autofix_prs: true
autoupdate_branch: dev
autoupdate_schedule: weekly
repos:
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 21.12b0
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.5.1
hooks:
- id: prettier

View File

@ -2,7 +2,6 @@ import abc
from contextlib import asynccontextmanager from contextlib import asynccontextmanager
from typing import Any, Dict, AsyncGenerator from typing import Any, Dict, AsyncGenerator
from ._bot import Bot
from nonebot.config import Config from nonebot.config import Config
from nonebot.drivers import ( from nonebot.drivers import (
Driver, Driver,
@ -15,6 +14,8 @@ from nonebot.drivers import (
WebSocketServerSetup, WebSocketServerSetup,
) )
from ._bot import Bot
class Adapter(abc.ABC): class Adapter(abc.ABC):
def __init__(self, driver: Driver, **kwargs: Any): def __init__(self, driver: Driver, **kwargs: Any):

View File

@ -2,9 +2,10 @@ import abc
from pydantic import BaseModel from pydantic import BaseModel
from ._message import Message
from nonebot.utils import DataclassEncoder from nonebot.utils import DataclassEncoder
from ._message import Message
class Event(abc.ABC, BaseModel): class Event(abc.ABC, BaseModel):
"""Event 基类。提供获取关键信息的方法,其余信息可直接获取。""" """Event 基类。提供获取关键信息的方法,其余信息可直接获取。"""

View File

@ -13,10 +13,11 @@ from pydantic.schema import get_annotation_from_field_info
from pydantic.fields import Required, FieldInfo, Undefined, ModelField from pydantic.fields import Required, FieldInfo, Undefined, ModelField
from nonebot.log import logger from nonebot.log import logger
from .utils import get_typed_signature
from nonebot.exception import TypeMisMatch from nonebot.exception import TypeMisMatch
from nonebot.utils import run_sync, is_coroutine_callable from nonebot.utils import run_sync, is_coroutine_callable
from .utils import get_typed_signature
T = TypeVar("T", bound="Dependent") T = TypeVar("T", bound="Dependent")
R = TypeVar("R") R = TypeVar("R")

View File

@ -19,15 +19,16 @@ from typing import (
AsyncGenerator, AsyncGenerator,
) )
from ._model import URL as URL
from nonebot.log import logger from nonebot.log import logger
from nonebot.utils import escape_tag from nonebot.utils import escape_tag
from ._model import Request as Request
from nonebot.config import Env, Config from nonebot.config import Env, Config
from nonebot.typing import T_BotConnectionHook, T_BotDisconnectionHook
from ._model import URL as URL
from ._model import Request as Request
from ._model import Response as Response from ._model import Response as Response
from ._model import WebSocket as WebSocket from ._model import WebSocket as WebSocket
from ._model import HTTPVersion as HTTPVersion from ._model import HTTPVersion as HTTPVersion
from nonebot.typing import T_BotConnectionHook, T_BotDisconnectionHook
if TYPE_CHECKING: if TYPE_CHECKING:
from nonebot.adapters import Bot, Adapter from nonebot.adapters import Bot, Adapter

View File

@ -16,7 +16,6 @@ from fastapi.responses import Response
from fastapi import FastAPI, Request, UploadFile, status from fastapi import FastAPI, Request, UploadFile, status
from starlette.websockets import WebSocket, WebSocketState, WebSocketDisconnect from starlette.websockets import WebSocket, WebSocketState, WebSocketDisconnect
from ._model import FileTypes
from nonebot.config import Env from nonebot.config import Env
from nonebot.typing import overrides from nonebot.typing import overrides
from nonebot.exception import WebSocketClosed from nonebot.exception import WebSocketClosed
@ -25,6 +24,8 @@ from nonebot.drivers import Request as BaseRequest
from nonebot.drivers import WebSocket as BaseWebSocket from nonebot.drivers import WebSocket as BaseWebSocket
from nonebot.drivers import ReverseDriver, HTTPServerSetup, WebSocketServerSetup from nonebot.drivers import ReverseDriver, HTTPServerSetup, WebSocketServerSetup
from ._model import FileTypes
def catch_closed(func): def catch_closed(func):
@wraps(func) @wraps(func)

View File

@ -11,7 +11,6 @@ from typing import List, Tuple, TypeVar, Callable, Optional, Coroutine
import uvicorn import uvicorn
from pydantic import BaseSettings from pydantic import BaseSettings
from ._model import FileTypes
from nonebot.config import Env from nonebot.config import Env
from nonebot.typing import overrides from nonebot.typing import overrides
from nonebot.exception import WebSocketClosed from nonebot.exception import WebSocketClosed
@ -20,6 +19,8 @@ from nonebot.drivers import Request as BaseRequest
from nonebot.drivers import WebSocket as BaseWebSocket from nonebot.drivers import WebSocket as BaseWebSocket
from nonebot.drivers import ReverseDriver, HTTPServerSetup, WebSocketServerSetup from nonebot.drivers import ReverseDriver, HTTPServerSetup, WebSocketServerSetup
from ._model import FileTypes
try: try:
from quart import request as _request from quart import request as _request
from quart import websocket as _websocket from quart import websocket as _websocket

View File

@ -10,6 +10,7 @@ from typing import Set, Dict, List, Union, Iterable, Optional, Sequence
from nonebot.log import logger from nonebot.log import logger
from nonebot.utils import escape_tag from nonebot.utils import escape_tag
from . import _managers, _current_plugin from . import _managers, _current_plugin
from .plugin import Plugin, _new_plugin, _confirm_plugin from .plugin import Plugin, _new_plugin, _confirm_plugin

View File

@ -5,7 +5,6 @@ from types import ModuleType
from typing import Any, Set, Dict, List, Type, Tuple, Union, Optional from typing import Any, Set, Dict, List, Type, Tuple, Union, Optional
from nonebot.matcher import Matcher from nonebot.matcher import Matcher
from .manager import _current_plugin
from nonebot.permission import Permission from nonebot.permission import Permission
from nonebot.dependencies import Dependent from nonebot.dependencies import Dependent
from nonebot.typing import ( from nonebot.typing import (
@ -25,6 +24,8 @@ from nonebot.rule import (
shell_command, shell_command,
) )
from .manager import _current_plugin
def _store_matcher(matcher: Type[Matcher]) -> None: def _store_matcher(matcher: Type[Matcher]) -> None:
plugin = _current_plugin.get() plugin = _current_plugin.get()

View File

@ -2,9 +2,10 @@ from types import ModuleType
from dataclasses import field, dataclass from dataclasses import field, dataclass
from typing import TYPE_CHECKING, Set, Dict, Type, Optional from typing import TYPE_CHECKING, Set, Dict, Type, Optional
from .export import Export
from nonebot.matcher import Matcher from nonebot.matcher import Matcher
from .export import Export
if TYPE_CHECKING: if TYPE_CHECKING:
from .manager import PluginManager from .manager import PluginManager

View File

@ -1,8 +1,9 @@
from pathlib import Path from pathlib import Path
from nonebot.drivers.fastapi import Driver
from fastapi.staticfiles import StaticFiles from fastapi.staticfiles import StaticFiles
from nonebot.drivers.fastapi import Driver
def register_route(driver: Driver): def register_route(driver: Driver):
app = driver.server_app app = driver.server_app

125
poetry.lock generated
View File

@ -208,6 +208,14 @@ python-versions = "*"
[package.dependencies] [package.dependencies]
pycparser = "*" pycparser = "*"
[[package]]
name = "cfgv"
version = "3.3.1"
description = "Validate configuration and produce human readable error messages."
category = "dev"
optional = false
python-versions = ">=3.6.1"
[[package]] [[package]]
name = "charset-normalizer" name = "charset-normalizer"
version = "2.0.10" version = "2.0.10"
@ -253,6 +261,14 @@ tomli = {version = "*", optional = true, markers = "extra == \"toml\""}
[package.extras] [package.extras]
toml = ["tomli"] toml = ["tomli"]
[[package]]
name = "distlib"
version = "0.3.4"
description = "Distribution utilities"
category = "dev"
optional = false
python-versions = "*"
[[package]] [[package]]
name = "execnet" name = "execnet"
version = "1.9.0" version = "1.9.0"
@ -282,6 +298,18 @@ dev = ["python-jose[cryptography] (>=3.3.0,<4.0.0)", "passlib[bcrypt] (>=1.7.2,<
doc = ["mkdocs (>=1.1.2,<2.0.0)", "mkdocs-material (>=7.1.9,<8.0.0)", "mdx-include (>=1.4.1,<2.0.0)", "mkdocs-markdownextradata-plugin (>=0.1.7,<0.3.0)", "typer-cli (>=0.0.12,<0.0.13)", "pyyaml (>=5.3.1,<6.0.0)"] doc = ["mkdocs (>=1.1.2,<2.0.0)", "mkdocs-material (>=7.1.9,<8.0.0)", "mdx-include (>=1.4.1,<2.0.0)", "mkdocs-markdownextradata-plugin (>=0.1.7,<0.3.0)", "typer-cli (>=0.0.12,<0.0.13)", "pyyaml (>=5.3.1,<6.0.0)"]
test = ["pytest (>=6.2.4,<7.0.0)", "pytest-cov (>=2.12.0,<4.0.0)", "mypy (==0.910)", "flake8 (>=3.8.3,<4.0.0)", "black (==21.9b0)", "isort (>=5.0.6,<6.0.0)", "requests (>=2.24.0,<3.0.0)", "httpx (>=0.14.0,<0.19.0)", "email_validator (>=1.1.1,<2.0.0)", "sqlalchemy (>=1.3.18,<1.5.0)", "peewee (>=3.13.3,<4.0.0)", "databases[sqlite] (>=0.3.2,<0.6.0)", "orjson (>=3.2.1,<4.0.0)", "ujson (>=4.0.1,<5.0.0)", "python-multipart (>=0.0.5,<0.0.6)", "flask (>=1.1.2,<3.0.0)", "anyio[trio] (>=3.2.1,<4.0.0)", "types-ujson (==0.1.1)", "types-orjson (==3.6.0)", "types-dataclasses (==0.1.7)"] test = ["pytest (>=6.2.4,<7.0.0)", "pytest-cov (>=2.12.0,<4.0.0)", "mypy (==0.910)", "flake8 (>=3.8.3,<4.0.0)", "black (==21.9b0)", "isort (>=5.0.6,<6.0.0)", "requests (>=2.24.0,<3.0.0)", "httpx (>=0.14.0,<0.19.0)", "email_validator (>=1.1.1,<2.0.0)", "sqlalchemy (>=1.3.18,<1.5.0)", "peewee (>=3.13.3,<4.0.0)", "databases[sqlite] (>=0.3.2,<0.6.0)", "orjson (>=3.2.1,<4.0.0)", "ujson (>=4.0.1,<5.0.0)", "python-multipart (>=0.0.5,<0.0.6)", "flask (>=1.1.2,<3.0.0)", "anyio[trio] (>=3.2.1,<4.0.0)", "types-ujson (==0.1.1)", "types-orjson (==3.6.0)", "types-dataclasses (==0.1.7)"]
[[package]]
name = "filelock"
version = "3.4.2"
description = "A platform independent file lock."
category = "dev"
optional = false
python-versions = ">=3.7"
[package.extras]
docs = ["furo (>=2021.8.17b43)", "sphinx (>=4.1)", "sphinx-autodoc-typehints (>=1.12)"]
testing = ["covdefaults (>=1.2.0)", "coverage (>=4)", "pytest (>=4)", "pytest-cov", "pytest-timeout (>=1.4.2)"]
[[package]] [[package]]
name = "frozenlist" name = "frozenlist"
version = "1.2.0" version = "1.2.0"
@ -396,6 +424,17 @@ category = "main"
optional = true optional = true
python-versions = ">=3.6.1" python-versions = ">=3.6.1"
[[package]]
name = "identify"
version = "2.4.4"
description = "File identification library for Python"
category = "dev"
optional = false
python-versions = ">=3.6.1"
[package.extras]
license = ["ukkonen"]
[[package]] [[package]]
name = "idna" name = "idna"
version = "3.3" version = "3.3"
@ -505,23 +544,12 @@ optional = false
python-versions = "*" python-versions = "*"
[[package]] [[package]]
name = "nb-autodoc" name = "nodeenv"
version = "0.1.0" version = "1.6.0"
description = "API doc generator for NoneBot." description = "Node.js virtual environment builder"
category = "dev" category = "dev"
optional = false optional = false
python-versions = ">=3.7" python-versions = "*"
develop = false
[package.dependencies]
attrs = ">=21.4,<22.0"
six = ">=1.6.1"
[package.source]
type = "git"
url = "https://github.com/nonebot/nb-autodoc.git"
reference = "master"
resolved_reference = "dae91520cf274d61d77be2c47d08e21b12547db6"
[[package]] [[package]]
name = "nonebug" name = "nonebug"
@ -591,6 +619,23 @@ importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""}
dev = ["pre-commit", "tox"] dev = ["pre-commit", "tox"]
testing = ["pytest", "pytest-benchmark"] testing = ["pytest", "pytest-benchmark"]
[[package]]
name = "pre-commit"
version = "2.16.0"
description = "A framework for managing and maintaining multi-language pre-commit hooks."
category = "dev"
optional = false
python-versions = ">=3.6.1"
[package.dependencies]
cfgv = ">=2.0.0"
identify = ">=1.0.0"
importlib-metadata = {version = "*", markers = "python_version < \"3.8\""}
nodeenv = ">=0.11.1"
pyyaml = ">=5.1"
toml = "*"
virtualenv = ">=20.0.8"
[[package]] [[package]]
name = "priority" name = "priority"
version = "2.0.0" version = "2.0.0"
@ -940,6 +985,25 @@ dev = ["Cython (>=0.29.24,<0.30.0)", "pytest (>=3.6.0)", "Sphinx (>=4.1.2,<4.2.0
docs = ["Sphinx (>=4.1.2,<4.2.0)", "sphinxcontrib-asyncio (>=0.3.0,<0.4.0)", "sphinx-rtd-theme (>=0.5.2,<0.6.0)"] docs = ["Sphinx (>=4.1.2,<4.2.0)", "sphinxcontrib-asyncio (>=0.3.0,<0.4.0)", "sphinx-rtd-theme (>=0.5.2,<0.6.0)"]
test = ["aiohttp", "flake8 (>=3.9.2,<3.10.0)", "psutil", "pycodestyle (>=2.7.0,<2.8.0)", "pyOpenSSL (>=19.0.0,<19.1.0)", "mypy (>=0.800)"] test = ["aiohttp", "flake8 (>=3.9.2,<3.10.0)", "psutil", "pycodestyle (>=2.7.0,<2.8.0)", "pyOpenSSL (>=19.0.0,<19.1.0)", "mypy (>=0.800)"]
[[package]]
name = "virtualenv"
version = "20.13.0"
description = "Virtual Python Environment builder"
category = "dev"
optional = false
python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7"
[package.dependencies]
distlib = ">=0.3.1,<1"
filelock = ">=3.2,<4"
importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""}
platformdirs = ">=2,<3"
six = ">=1.9.0,<2"
[package.extras]
docs = ["proselint (>=0.10.2)", "sphinx (>=3)", "sphinx-argparse (>=0.2.5)", "sphinx-rtd-theme (>=0.4.3)", "towncrier (>=21.3)"]
testing = ["coverage (>=4)", "coverage-enable-subprocess (>=1)", "flaky (>=3)", "pytest (>=4)", "pytest-env (>=0.6.2)", "pytest-freezegun (>=0.4.1)", "pytest-mock (>=2)", "pytest-randomly (>=1)", "pytest-timeout (>=1)", "packaging (>=20.0)"]
[[package]] [[package]]
name = "watchgod" name = "watchgod"
version = "0.7" version = "0.7"
@ -1024,7 +1088,7 @@ websockets = ["websockets"]
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = "^3.7.3" python-versions = "^3.7.3"
content-hash = "4687997c6c2b8512cc150caa206a6b690379ab9b22d695970918887fe09e2e77" content-hash = "9e9f256a3c469733ebc2196be86616327872dec3ef6238045a129f8bd9491fde"
[metadata.files] [metadata.files]
aiodns = [ aiodns = [
@ -1283,6 +1347,10 @@ cffi = [
{file = "cffi-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:3773c4d81e6e818df2efbc7dd77325ca0dcb688116050fb2b3011218eda36139"}, {file = "cffi-1.15.0-cp39-cp39-win_amd64.whl", hash = "sha256:3773c4d81e6e818df2efbc7dd77325ca0dcb688116050fb2b3011218eda36139"},
{file = "cffi-1.15.0.tar.gz", hash = "sha256:920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954"}, {file = "cffi-1.15.0.tar.gz", hash = "sha256:920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954"},
] ]
cfgv = [
{file = "cfgv-3.3.1-py2.py3-none-any.whl", hash = "sha256:c6a0883f3917a037485059700b9e75da2464e6c27051014ad85ba6aaa5884426"},
{file = "cfgv-3.3.1.tar.gz", hash = "sha256:f5a830efb9ce7a445376bb66ec94c638a9787422f96264c98edc6bdeed8ab736"},
]
charset-normalizer = [ charset-normalizer = [
{file = "charset-normalizer-2.0.10.tar.gz", hash = "sha256:876d180e9d7432c5d1dfd4c5d26b72f099d503e8fcc0feb7532c9289be60fcbd"}, {file = "charset-normalizer-2.0.10.tar.gz", hash = "sha256:876d180e9d7432c5d1dfd4c5d26b72f099d503e8fcc0feb7532c9289be60fcbd"},
{file = "charset_normalizer-2.0.10-py3-none-any.whl", hash = "sha256:cb957888737fc0bbcd78e3df769addb41fd1ff8cf950dc9e7ad7793f1bf44455"}, {file = "charset_normalizer-2.0.10-py3-none-any.whl", hash = "sha256:cb957888737fc0bbcd78e3df769addb41fd1ff8cf950dc9e7ad7793f1bf44455"},
@ -1344,6 +1412,10 @@ coverage = [
{file = "coverage-6.2-pp36.pp37.pp38-none-any.whl", hash = "sha256:5829192582c0ec8ca4a2532407bc14c2f338d9878a10442f5d03804a95fac9de"}, {file = "coverage-6.2-pp36.pp37.pp38-none-any.whl", hash = "sha256:5829192582c0ec8ca4a2532407bc14c2f338d9878a10442f5d03804a95fac9de"},
{file = "coverage-6.2.tar.gz", hash = "sha256:e2cad8093172b7d1595b4ad66f24270808658e11acf43a8f95b41276162eb5b8"}, {file = "coverage-6.2.tar.gz", hash = "sha256:e2cad8093172b7d1595b4ad66f24270808658e11acf43a8f95b41276162eb5b8"},
] ]
distlib = [
{file = "distlib-0.3.4-py2.py3-none-any.whl", hash = "sha256:6564fe0a8f51e734df6333d08b8b94d4ea8ee6b99b5ed50613f731fd4089f34b"},
{file = "distlib-0.3.4.zip", hash = "sha256:e4b58818180336dc9c529bfb9a0b58728ffc09ad92027a3f30b7cd91e3458579"},
]
execnet = [ execnet = [
{file = "execnet-1.9.0-py2.py3-none-any.whl", hash = "sha256:a295f7cc774947aac58dde7fdc85f4aa00c42adf5d8f5468fc630c1acf30a142"}, {file = "execnet-1.9.0-py2.py3-none-any.whl", hash = "sha256:a295f7cc774947aac58dde7fdc85f4aa00c42adf5d8f5468fc630c1acf30a142"},
{file = "execnet-1.9.0.tar.gz", hash = "sha256:8f694f3ba9cc92cab508b152dcfe322153975c29bda272e2fd7f3f00f36e47c5"}, {file = "execnet-1.9.0.tar.gz", hash = "sha256:8f694f3ba9cc92cab508b152dcfe322153975c29bda272e2fd7f3f00f36e47c5"},
@ -1352,6 +1424,10 @@ fastapi = [
{file = "fastapi-0.70.1-py3-none-any.whl", hash = "sha256:5367226c7bcd7bfb2e17edaf225fd9a983095b1372281e9a3eb661336fb93748"}, {file = "fastapi-0.70.1-py3-none-any.whl", hash = "sha256:5367226c7bcd7bfb2e17edaf225fd9a983095b1372281e9a3eb661336fb93748"},
{file = "fastapi-0.70.1.tar.gz", hash = "sha256:21d03979b5336375c66fa5d1f3126c6beca650d5d2166fbb78345a30d33c8d06"}, {file = "fastapi-0.70.1.tar.gz", hash = "sha256:21d03979b5336375c66fa5d1f3126c6beca650d5d2166fbb78345a30d33c8d06"},
] ]
filelock = [
{file = "filelock-3.4.2-py3-none-any.whl", hash = "sha256:cf0fc6a2f8d26bd900f19bf33915ca70ba4dd8c56903eeb14e1e7a2fd7590146"},
{file = "filelock-3.4.2.tar.gz", hash = "sha256:38b4f4c989f9d06d44524df1b24bd19e167d851f19b50bf3e3559952dddc5b80"},
]
frozenlist = [ frozenlist = [
{file = "frozenlist-1.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:977a1438d0e0d96573fd679d291a1542097ea9f4918a8b6494b06610dfeefbf9"}, {file = "frozenlist-1.2.0-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:977a1438d0e0d96573fd679d291a1542097ea9f4918a8b6494b06610dfeefbf9"},
{file = "frozenlist-1.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a8d86547a5e98d9edd47c432f7a14b0c5592624b496ae9880fb6332f34af1edc"}, {file = "frozenlist-1.2.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a8d86547a5e98d9edd47c432f7a14b0c5592624b496ae9880fb6332f34af1edc"},
@ -1471,6 +1547,10 @@ hyperframe = [
{file = "hyperframe-6.0.1-py3-none-any.whl", hash = "sha256:0ec6bafd80d8ad2195c4f03aacba3a8265e57bc4cff261e802bf39970ed02a15"}, {file = "hyperframe-6.0.1-py3-none-any.whl", hash = "sha256:0ec6bafd80d8ad2195c4f03aacba3a8265e57bc4cff261e802bf39970ed02a15"},
{file = "hyperframe-6.0.1.tar.gz", hash = "sha256:ae510046231dc8e9ecb1a6586f63d2347bf4c8905914aa84ba585ae85f28a914"}, {file = "hyperframe-6.0.1.tar.gz", hash = "sha256:ae510046231dc8e9ecb1a6586f63d2347bf4c8905914aa84ba585ae85f28a914"},
] ]
identify = [
{file = "identify-2.4.4-py2.py3-none-any.whl", hash = "sha256:aa68609c7454dbcaae60a01ff6b8df1de9b39fe6e50b1f6107ec81dcda624aa6"},
{file = "identify-2.4.4.tar.gz", hash = "sha256:6b4b5031f69c48bf93a646b90de9b381c6b5f560df4cbe0ed3cf7650ae741e4d"},
]
idna = [ idna = [
{file = "idna-3.3-py3-none-any.whl", hash = "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"}, {file = "idna-3.3-py3-none-any.whl", hash = "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"},
{file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"}, {file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"},
@ -1648,7 +1728,10 @@ mypy-extensions = [
{file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"},
{file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"},
] ]
nb-autodoc = [] nodeenv = [
{file = "nodeenv-1.6.0-py2.py3-none-any.whl", hash = "sha256:621e6b7076565ddcacd2db0294c0381e01fd28945ab36bcf00f41c5daf63bef7"},
{file = "nodeenv-1.6.0.tar.gz", hash = "sha256:3ef13ff90291ba2a4a7a4ff9a979b63ffdd00a464dbe04acf0ea6471517a4c2b"},
]
nonebug = [] nonebug = []
packaging = [ packaging = [
{file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"}, {file = "packaging-21.3-py3-none-any.whl", hash = "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522"},
@ -1666,6 +1749,10 @@ pluggy = [
{file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"}, {file = "pluggy-1.0.0-py2.py3-none-any.whl", hash = "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3"},
{file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"}, {file = "pluggy-1.0.0.tar.gz", hash = "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159"},
] ]
pre-commit = [
{file = "pre_commit-2.16.0-py2.py3-none-any.whl", hash = "sha256:758d1dc9b62c2ed8881585c254976d66eae0889919ab9b859064fc2fe3c7743e"},
{file = "pre_commit-2.16.0.tar.gz", hash = "sha256:fe9897cac830aa7164dbd02a4e7b90cae49630451ce88464bca73db486ba9f65"},
]
priority = [ priority = [
{file = "priority-2.0.0-py3-none-any.whl", hash = "sha256:6f8eefce5f3ad59baf2c080a664037bb4725cd0a790d53d59ab4059288faf6aa"}, {file = "priority-2.0.0-py3-none-any.whl", hash = "sha256:6f8eefce5f3ad59baf2c080a664037bb4725cd0a790d53d59ab4059288faf6aa"},
{file = "priority-2.0.0.tar.gz", hash = "sha256:c965d54f1b8d0d0b19479db3924c7c36cf672dbf2aec92d43fbdaf4492ba18c0"}, {file = "priority-2.0.0.tar.gz", hash = "sha256:c965d54f1b8d0d0b19479db3924c7c36cf672dbf2aec92d43fbdaf4492ba18c0"},
@ -1901,6 +1988,10 @@ uvloop = [
{file = "uvloop-0.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e5f2e2ff51aefe6c19ee98af12b4ae61f5be456cd24396953244a30880ad861"}, {file = "uvloop-0.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e5f2e2ff51aefe6c19ee98af12b4ae61f5be456cd24396953244a30880ad861"},
{file = "uvloop-0.16.0.tar.gz", hash = "sha256:f74bc20c7b67d1c27c72601c78cf95be99d5c2cdd4514502b4f3eb0933ff1228"}, {file = "uvloop-0.16.0.tar.gz", hash = "sha256:f74bc20c7b67d1c27c72601c78cf95be99d5c2cdd4514502b4f3eb0933ff1228"},
] ]
virtualenv = [
{file = "virtualenv-20.13.0-py2.py3-none-any.whl", hash = "sha256:339f16c4a86b44240ba7223d0f93a7887c3ca04b5f9c8129da7958447d079b09"},
{file = "virtualenv-20.13.0.tar.gz", hash = "sha256:d8458cf8d59d0ea495ad9b34c2599487f8a7772d796f9910858376d1600dd2dd"},
]
watchgod = [ watchgod = [
{file = "watchgod-0.7-py3-none-any.whl", hash = "sha256:d6c1ea21df37847ac0537ca0d6c2f4cdf513562e95f77bb93abbcf05573407b7"}, {file = "watchgod-0.7-py3-none-any.whl", hash = "sha256:d6c1ea21df37847ac0537ca0d6c2f4cdf513562e95f77bb93abbcf05573407b7"},
{file = "watchgod-0.7.tar.gz", hash = "sha256:48140d62b0ebe9dd9cf8381337f06351e1f2e70b2203fa9c6eff4e572ca84f29"}, {file = "watchgod-0.7.tar.gz", hash = "sha256:48140d62b0ebe9dd9cf8381337f06351e1f2e70b2203fa9c6eff4e572ca84f29"},

View File

@ -40,9 +40,9 @@ httpx = { version = ">=0.20.0, <1.0.0", extras = ["http2"], optional = true }
isort = "^5.10.1" isort = "^5.10.1"
black = "^21.11b1" black = "^21.11b1"
pytest-cov = "^3.0.0" pytest-cov = "^3.0.0"
pre-commit = "^2.16.0"
pytest-xdist = "^2.5.0" pytest-xdist = "^2.5.0"
nonebug = { git = "https://github.com/nonebot/nonebug.git" } nonebug = { git = "https://github.com/nonebot/nonebug.git" }
nb-autodoc = {git = "https://github.com/nonebot/nb-autodoc.git"}
[tool.poetry.extras] [tool.poetry.extras]
quart = ["quart"] quart = ["quart"]
@ -72,7 +72,7 @@ line_length = 80
length_sort = true length_sort = true
skip_gitignore = true skip_gitignore = true
force_sort_within_sections = true force_sort_within_sections = true
known_local_folder = ["nonebot"] src_paths = ["nonebot", "tests"]
extra_standard_library = ["typing_extensions"] extra_standard_library = ["typing_extensions"]
[build-system] [build-system]

View File

@ -1,8 +0,0 @@
[settings]
profile=black
line_length=80
length_sort=true
skip_gitignore=true
force_sort_within_sections=true
known_local_folder=plugins
extra_standard_library=typing_extensions

View File

@ -1,6 +1,6 @@
from nonebot import require from nonebot import require
from plugins.export import test from plugins.export import test
from .export import test as test_related from .export import test as test_related
test_require = require("export").test test_require = require("export").test

View File

@ -103,7 +103,6 @@ async def test_type_updater(app: App, load_plugin):
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_permission_updater(app: App, load_plugin): async def test_permission_updater(app: App, load_plugin):
from nonebot.permission import User from nonebot.permission import User
from plugins.matcher.matcher_permission import ( from plugins.matcher.matcher_permission import (
default_permission, default_permission,
test_custom_updater, test_custom_updater,

View File

@ -7,7 +7,6 @@ from utils import make_fake_event, make_fake_message
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_depend(app: App, load_plugin): async def test_depend(app: App, load_plugin):
from nonebot.params import DependParam from nonebot.params import DependParam
from plugins.param.param_depend import ( from plugins.param.param_depend import (
ClassDependency, ClassDependency,
runned, runned,
@ -37,7 +36,6 @@ async def test_depend(app: App, load_plugin):
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_bot(app: App, load_plugin): async def test_bot(app: App, load_plugin):
from nonebot.params import BotParam from nonebot.params import BotParam
from plugins.param.param_bot import get_bot from plugins.param.param_bot import get_bot
async with app.test_dependent(get_bot, allow_types=[BotParam]) as ctx: async with app.test_dependent(get_bot, allow_types=[BotParam]) as ctx:
@ -49,7 +47,6 @@ async def test_bot(app: App, load_plugin):
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_event(app: App, load_plugin): async def test_event(app: App, load_plugin):
from nonebot.params import EventParam, DependParam from nonebot.params import EventParam, DependParam
from plugins.param.param_event import ( from plugins.param.param_event import (
event, event,
event_type, event_type,
@ -104,7 +101,6 @@ async def test_state(app: App, load_plugin):
REGEX_GROUP, REGEX_GROUP,
REGEX_MATCHED, REGEX_MATCHED,
) )
from plugins.param.param_state import ( from plugins.param.param_state import (
state, state,
command, command,
@ -184,7 +180,6 @@ async def test_state(app: App, load_plugin):
async def test_matcher(app: App, load_plugin): async def test_matcher(app: App, load_plugin):
from nonebot.matcher import Matcher from nonebot.matcher import Matcher
from nonebot.params import DependParam, MatcherParam from nonebot.params import DependParam, MatcherParam
from plugins.param.param_matcher import matcher, receive, last_receive from plugins.param.param_matcher import matcher, receive, last_receive
fake_matcher = Matcher() fake_matcher = Matcher()
@ -215,7 +210,6 @@ async def test_matcher(app: App, load_plugin):
async def test_arg(app: App, load_plugin): async def test_arg(app: App, load_plugin):
from nonebot.matcher import Matcher from nonebot.matcher import Matcher
from nonebot.params import ArgParam from nonebot.params import ArgParam
from plugins.param.param_arg import arg, arg_str, arg_plain_text from plugins.param.param_arg import arg, arg_str, arg_plain_text
matcher = Matcher() matcher = Matcher()
@ -238,7 +232,6 @@ async def test_arg(app: App, load_plugin):
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_exception(app: App, load_plugin): async def test_exception(app: App, load_plugin):
from nonebot.params import ExceptionParam from nonebot.params import ExceptionParam
from plugins.param.param_exception import exc from plugins.param.param_exception import exc
exception = ValueError("test") exception = ValueError("test")
@ -250,7 +243,6 @@ async def test_exception(app: App, load_plugin):
@pytest.mark.asyncio @pytest.mark.asyncio
async def test_default(app: App, load_plugin): async def test_default(app: App, load_plugin):
from nonebot.params import DefaultParam from nonebot.params import DefaultParam
from plugins.param.param_default import default from plugins.param.param_default import default
async with app.test_dependent(default, allow_types=[DefaultParam]) as ctx: async with app.test_dependent(default, allow_types=[DefaultParam]) as ctx:

View File

@ -1,3 +1,3 @@
module.exports = { module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], presets: [require.resolve("@docusaurus/core/lib/babel/preset")],
}; };

View File

@ -22,7 +22,7 @@ const config = {
"zh-Hans": { label: "简体中文" }, "zh-Hans": { label: "简体中文" },
}, },
}, },
scripts: ["/unregister-sw.js"], scripts: ["/unregister-sw.js"],
presets: [ presets: [

View File

@ -24,7 +24,6 @@
@apply bg-hero text-white border-hero; @apply bg-hero text-white border-hero;
} }
.disabled { .disabled {
@apply opacity-60 pointer-events-none; @apply opacity-60 pointer-events-none;
} }

View File

@ -838,4 +838,4 @@
"tags": [], "tags": [],
"is_official": false "is_official": false
} }
] ]

View File

@ -1 +1,16 @@
navigator.serviceWorker.getRegistrations().then(function(e){for(var r,i=e,t=Array.isArray(i),a=0,i=t?i:i[Symbol.iterator]();;){if(t){if(a>=i.length)break;r=i[a++]}else{if((a=i.next()).done)break;r=a.value}r.unregister()}}); navigator.serviceWorker.getRegistrations().then(function (e) {
for (
var r, i = e, t = Array.isArray(i), a = 0, i = t ? i : i[Symbol.iterator]();
;
) {
if (t) {
if (a >= i.length) break;
r = i[a++];
} else {
if ((a = i.next()).done) break;
r = a.value;
}
r.unregister();
}
});

View File

@ -1,3 +1 @@
[ ["2.0.0-beta.1"]
"2.0.0-beta.1"
]