From 1c87c83c4555b3823200823012f135e1b3c9d088 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sun, 22 Nov 2020 01:18:46 +0800 Subject: [PATCH 01/34] :construction_worker: add pull upstream ci --- .github/pull.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/pull.yml diff --git a/.github/pull.yml b/.github/pull.yml new file mode 100644 index 00000000..76879bce --- /dev/null +++ b/.github/pull.yml @@ -0,0 +1,16 @@ +version: "1" +rules: # Array of rules + - base: master # Required. Target branch + upstream: nonebot:master # Required. Must be in the same fork network. + mergeMethod: rebase # Optional, one of [none, merge, squash, rebase, hardreset], Default: none. + mergeUnstable: false # Optional, merge pull request even when the mergeable_state is not clean. Default: false + - base: dev + upstream: nonebot:dev # Required. Can be a branch in the same forked repo. + assignees: # Optional + - yanyongyu + reviewers: # Optional + - yanyongyu + conflictReviewers: # Optional, on merge conflict assign a reviewer + - yanyongyu +label: ":arrow_heading_down: pull" # Optional +conflictLabel: "merge-conflict" # Optional, on merge conflict assign a custom label, Default: merge-conflict From 339e6cd665c9b18d899f2d88bbfc718b4dfb5445 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sun, 22 Nov 2020 01:20:14 +0800 Subject: [PATCH 02/34] :package: add nonebot plugin docs --- packages/nonebot-plugin-docs/README.md | 8 + .../nonebot_plugin_docs/__init__.py | 37 ++ .../nonebot_plugin_docs/drivers/fastapi.py | 26 ++ packages/nonebot-plugin-docs/poetry.lock | 398 ++++++++++++++++++ packages/nonebot-plugin-docs/pyproject.toml | 17 + 5 files changed, 486 insertions(+) create mode 100644 packages/nonebot-plugin-docs/README.md create mode 100644 packages/nonebot-plugin-docs/nonebot_plugin_docs/__init__.py create mode 100644 packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py create mode 100644 packages/nonebot-plugin-docs/poetry.lock create mode 100644 packages/nonebot-plugin-docs/pyproject.toml diff --git a/packages/nonebot-plugin-docs/README.md b/packages/nonebot-plugin-docs/README.md new file mode 100644 index 00000000..463d5b92 --- /dev/null +++ b/packages/nonebot-plugin-docs/README.md @@ -0,0 +1,8 @@ + diff --git a/packages/nonebot-plugin-docs/nonebot_plugin_docs/__init__.py b/packages/nonebot-plugin-docs/nonebot_plugin_docs/__init__.py new file mode 100644 index 00000000..848d9438 --- /dev/null +++ b/packages/nonebot-plugin-docs/nonebot_plugin_docs/__init__.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +@Author : yanyongyu +@Date : 2020-11-22 00:56:58 +@LastEditors : yanyongyu +@LastEditTime : 2020-11-22 01:00:29 +@Description : None +@GitHub : https://github.com/yanyongyu +""" +__author__ = "yanyongyu" + +import importlib + +import nonebot +from nonebot.log import logger + + +def init(): + driver = nonebot.get_driver() + try: + _module = importlib.import_module( + f"nonebot_plugin_docs.drivers.{driver.type}") + except ImportError: + logger.warning(f"Driver {driver.type} not supported") + return + register_route = getattr(_module, "register_route") + register_route(driver) + host = str(driver.config.host) + port = driver.config.port + if host in ["0.0.0.0", "127.0.0.1"]: + host = "localhost" + logger.opt(colors=True).info(f"Nonebot docs will be running at: " + f"http://{host}:{port}/docs/") + + +init() diff --git a/packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py b/packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py new file mode 100644 index 00000000..217decea --- /dev/null +++ b/packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +@Author : yanyongyu +@Date : 2020-11-22 00:56:31 +@LastEditors : yanyongyu +@LastEditTime : 2020-11-22 01:03:05 +@Description : None +@GitHub : https://github.com/yanyongyu +""" +__author__ = "yanyongyu" + +from pathlib import Path + +from nonebot.drivers.fastapi import Driver +from fastapi.staticfiles import StaticFiles + + +def register_route(driver: Driver, socketio): + app = driver.server_app + + static_path = str((Path(__file__).parent / ".." / "dist").resolve()) + + app.mount("/docs", + StaticFiles(directory=static_path, html=True), + name="docs") diff --git a/packages/nonebot-plugin-docs/poetry.lock b/packages/nonebot-plugin-docs/poetry.lock new file mode 100644 index 00000000..ae3f9365 --- /dev/null +++ b/packages/nonebot-plugin-docs/poetry.lock @@ -0,0 +1,398 @@ +[[package]] +name = "certifi" +version = "2020.11.8" +description = "Python package for providing Mozilla's CA Bundle." +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "click" +version = "7.1.2" +description = "Composable command line interface toolkit" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "colorama" +version = "0.4.4" +description = "Cross-platform colored terminal text." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "fastapi" +version = "0.58.1" +description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +pydantic = ">=0.32.2,<2.0.0" +starlette = "0.13.4" + +[package.extras] +all = ["requests", "aiofiles", "jinja2", "python-multipart", "itsdangerous", "pyyaml", "graphene", "ujson", "orjson", "email-validator", "uvicorn", "async-exit-stack", "async-generator"] +dev = ["pyjwt", "passlib", "autoflake", "flake8", "uvicorn", "graphene"] +doc = ["mkdocs", "mkdocs-material", "markdown-include", "typer", "typer-cli", "pyyaml"] +test = ["pytest (==5.4.3)", "pytest-cov (==2.10.0)", "mypy", "black", "isort", "requests", "email-validator", "sqlalchemy", "peewee", "databases", "orjson", "async-exit-stack", "async-generator", "python-multipart", "aiofiles", "flask"] + +[[package]] +name = "h11" +version = "0.9.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "httpcore" +version = "0.12.2" +description = "A minimal low-level HTTP client." +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +h11 = "<1.0.0" +sniffio = ">=1.0.0,<2.0.0" + +[package.extras] +http2 = ["h2 (>=3,<5)"] + +[[package]] +name = "httptools" +version = "0.1.1" +description = "A collection of framework independent HTTP protocol utils." +category = "main" +optional = false +python-versions = "*" + +[package.extras] +test = ["Cython (==0.29.14)"] + +[[package]] +name = "httpx" +version = "0.16.1" +description = "The next generation HTTP client." +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +certifi = "*" +httpcore = ">=0.12.0,<0.13.0" +rfc3986 = {version = ">=1.3,<2", extras = ["idna2008"]} +sniffio = "*" + +[package.extras] +brotli = ["brotlipy (>=0.7.0,<0.8.0)"] +http2 = ["h2 (>=3.0.0,<4.0.0)"] + +[[package]] +name = "idna" +version = "2.10" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "loguru" +version = "0.5.3" +description = "Python logging made (stupidly) simple" +category = "main" +optional = false +python-versions = ">=3.5" + +[package.dependencies] +colorama = {version = ">=0.3.4", markers = "sys_platform == \"win32\""} +win32-setctime = {version = ">=1.0.0", markers = "sys_platform == \"win32\""} + +[package.extras] +dev = ["codecov (>=2.0.15)", "colorama (>=0.3.4)", "flake8 (>=3.7.7)", "tox (>=3.9.0)", "tox-travis (>=0.12)", "pytest (>=4.6.2)", "pytest-cov (>=2.7.1)", "Sphinx (>=2.2.1)", "sphinx-autobuild (>=0.7.1)", "sphinx-rtd-theme (>=0.4.3)", "black (>=19.10b0)", "isort (>=5.1.1)"] + +[[package]] +name = "nonebot2" +version = "2.0.0a6" +description = "An asynchronous python bot framework." +category = "main" +optional = false +python-versions = ">=3.7,<4.0" + +[package.dependencies] +fastapi = ">=0.58.1,<0.59.0" +httpx = ">=0.16.1,<0.17.0" +loguru = ">=0.5.1,<0.6.0" +pydantic = {version = ">=1.6.1,<2.0.0", extras = ["dotenv"]} +pygtrie = ">=2.3.3,<3.0.0" +uvicorn = ">=0.11.5,<0.12.0" + +[package.extras] +scheduler = ["apscheduler (>=3.6.3,<4.0.0)"] +full = ["apscheduler (>=3.6.3,<4.0.0)", "nonebot-test (>=0.1.0,<0.2.0)", "nb-cli (>=0.2.0,<0.3.0)"] +test = ["nonebot-test (>=0.1.0,<0.2.0)"] +cli = ["nb-cli (>=0.2.0,<0.3.0)"] + +[[package]] +name = "pydantic" +version = "1.7.2" +description = "Data validation and settings management using python 3.6 type hinting" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +python-dotenv = {version = ">=0.10.4", optional = true, markers = "extra == \"dotenv\""} + +[package.extras] +dotenv = ["python-dotenv (>=0.10.4)"] +email = ["email-validator (>=1.0.3)"] +typing_extensions = ["typing-extensions (>=3.7.2)"] + +[[package]] +name = "pygtrie" +version = "2.4.1" +description = "A pure Python trie data structure implementation." +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "python-dotenv" +version = "0.15.0" +description = "Add .env support to your django/flask apps in development and deployments" +category = "main" +optional = false +python-versions = "*" + +[package.extras] +cli = ["click (>=5.0)"] + +[[package]] +name = "rfc3986" +version = "1.4.0" +description = "Validating URI References per RFC 3986" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +idna = {version = "*", optional = true, markers = "extra == \"idna2008\""} + +[package.extras] +idna2008 = ["idna"] + +[[package]] +name = "sniffio" +version = "1.2.0" +description = "Sniff out which async library your code is running under" +category = "main" +optional = false +python-versions = ">=3.5" + +[[package]] +name = "starlette" +version = "0.13.4" +description = "The little ASGI library that shines." +category = "main" +optional = false +python-versions = ">=3.6" + +[package.extras] +full = ["aiofiles", "graphene", "itsdangerous", "jinja2", "python-multipart", "pyyaml", "requests", "ujson"] + +[[package]] +name = "uvicorn" +version = "0.11.8" +description = "The lightning-fast ASGI server." +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +click = ">=7.0.0,<8.0.0" +h11 = ">=0.8,<0.10" +httptools = {version = ">=0.1.0,<0.2.0", markers = "sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\""} +uvloop = {version = ">=0.14.0", markers = "sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\""} +websockets = ">=8.0.0,<9.0.0" + +[package.extras] +watchgodreload = ["watchgod (>=0.6,<0.7)"] + +[[package]] +name = "uvloop" +version = "0.14.0" +description = "Fast implementation of asyncio event loop on top of libuv" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "websockets" +version = "8.1" +description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" +category = "main" +optional = false +python-versions = ">=3.6.1" + +[[package]] +name = "win32-setctime" +version = "1.0.3" +description = "A small Python utility to set file creation time on Windows" +category = "main" +optional = false +python-versions = ">=3.5" + +[package.extras] +dev = ["pytest (>=4.6.2)", "black (>=19.3b0)"] + +[metadata] +lock-version = "1.1" +python-versions = "^3.7" +content-hash = "27e9698a6239bc8d04cf78c6cfb4ff1295a7277bc081013e85bec67df21cbade" + +[metadata.files] +certifi = [ + {file = "certifi-2020.11.8-py2.py3-none-any.whl", hash = "sha256:1f422849db327d534e3d0c5f02a263458c3955ec0aae4ff09b95f195c59f4edd"}, + {file = "certifi-2020.11.8.tar.gz", hash = "sha256:f05def092c44fbf25834a51509ef6e631dc19765ab8a57b4e7ab85531f0a9cf4"}, +] +click = [ + {file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"}, + {file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"}, +] +colorama = [ + {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, + {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, +] +fastapi = [ + {file = "fastapi-0.58.1-py3-none-any.whl", hash = "sha256:d7499761d5ca901cdf5b6b73018d14729593f8ab1ea22d241f82fa574fc406ad"}, + {file = "fastapi-0.58.1.tar.gz", hash = "sha256:92e59b77eef7d6eaa80b16d275adda06b5f33b12d777e3fc5521b2f7f4718e13"}, +] +h11 = [ + {file = "h11-0.9.0-py2.py3-none-any.whl", hash = "sha256:4bc6d6a1238b7615b266ada57e0618568066f57dd6fa967d1290ec9309b2f2f1"}, + {file = "h11-0.9.0.tar.gz", hash = "sha256:33d4bca7be0fa039f4e84d50ab00531047e53d6ee8ffbc83501ea602c169cae1"}, +] +httpcore = [ + {file = "httpcore-0.12.2-py3-none-any.whl", hash = "sha256:420700af11db658c782f7e8fda34f9dcd95e3ee93944dd97d78cb70247e0cd06"}, + {file = "httpcore-0.12.2.tar.gz", hash = "sha256:dd1d762d4f7c2702149d06be2597c35fb154c5eff9789a8c5823fbcf4d2978d6"}, +] +httptools = [ + {file = "httptools-0.1.1-cp35-cp35m-macosx_10_13_x86_64.whl", hash = "sha256:a2719e1d7a84bb131c4f1e0cb79705034b48de6ae486eb5297a139d6a3296dce"}, + {file = "httptools-0.1.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:fa3cd71e31436911a44620473e873a256851e1f53dee56669dae403ba41756a4"}, + {file = "httptools-0.1.1-cp36-cp36m-macosx_10_13_x86_64.whl", hash = "sha256:86c6acd66765a934e8730bf0e9dfaac6fdcf2a4334212bd4a0a1c78f16475ca6"}, + {file = "httptools-0.1.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:bc3114b9edbca5a1eb7ae7db698c669eb53eb8afbbebdde116c174925260849c"}, + {file = "httptools-0.1.1-cp36-cp36m-win_amd64.whl", hash = "sha256:ac0aa11e99454b6a66989aa2d44bca41d4e0f968e395a0a8f164b401fefe359a"}, + {file = "httptools-0.1.1-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:96da81e1992be8ac2fd5597bf0283d832287e20cb3cfde8996d2b00356d4e17f"}, + {file = "httptools-0.1.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:56b6393c6ac7abe632f2294da53f30d279130a92e8ae39d8d14ee2e1b05ad1f2"}, + {file = "httptools-0.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:96eb359252aeed57ea5c7b3d79839aaa0382c9d3149f7d24dd7172b1bcecb009"}, + {file = "httptools-0.1.1-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:fea04e126014169384dee76a153d4573d90d0cbd1d12185da089f73c78390437"}, + {file = "httptools-0.1.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:3592e854424ec94bd17dc3e0c96a64e459ec4147e6d53c0a42d0ebcef9cb9c5d"}, + {file = "httptools-0.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:0a4b1b2012b28e68306575ad14ad5e9120b34fccd02a81eb08838d7e3bbb48be"}, + {file = "httptools-0.1.1.tar.gz", hash = "sha256:41b573cf33f64a8f8f3400d0a7faf48e1888582b6f6e02b82b9bd4f0bf7497ce"}, +] +httpx = [ + {file = "httpx-0.16.1-py3-none-any.whl", hash = "sha256:9cffb8ba31fac6536f2c8cde30df859013f59e4bcc5b8d43901cb3654a8e0a5b"}, + {file = "httpx-0.16.1.tar.gz", hash = "sha256:126424c279c842738805974687e0518a94c7ae8d140cd65b9c4f77ac46ffa537"}, +] +idna = [ + {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, + {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, +] +loguru = [ + {file = "loguru-0.5.3-py3-none-any.whl", hash = "sha256:f8087ac396b5ee5f67c963b495d615ebbceac2796379599820e324419d53667c"}, + {file = "loguru-0.5.3.tar.gz", hash = "sha256:b28e72ac7a98be3d28ad28570299a393dfcd32e5e3f6a353dec94675767b6319"}, +] +nonebot2 = [ + {file = "nonebot2-2.0.0a6-py3-none-any.whl", hash = "sha256:a34154f434cbe1421dc28f199dddddda5b02984674035487da9548205234a6c3"}, + {file = "nonebot2-2.0.0a6.tar.gz", hash = "sha256:b1f89a311958a8363c813d96327854c8d34aeb0bc3720def8d8f32f8155ec37d"}, +] +pydantic = [ + {file = "pydantic-1.7.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:dfaa6ed1d509b5aef4142084206584280bb6e9014f01df931ec6febdad5b200a"}, + {file = "pydantic-1.7.2-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:2182ba2a9290964b278bcc07a8d24207de709125d520efec9ad6fa6f92ee058d"}, + {file = "pydantic-1.7.2-cp36-cp36m-manylinux2014_i686.whl", hash = "sha256:0fe8b45d31ae53d74a6aa0bf801587bd49970070eac6a6326f9fa2a302703b8a"}, + {file = "pydantic-1.7.2-cp36-cp36m-manylinux2014_x86_64.whl", hash = "sha256:01f0291f4951580f320f7ae3f2ecaf0044cdebcc9b45c5f882a7e84453362420"}, + {file = "pydantic-1.7.2-cp36-cp36m-win_amd64.whl", hash = "sha256:4ba6b903e1b7bd3eb5df0e78d7364b7e831ed8b4cd781ebc3c4f1077fbcb72a4"}, + {file = "pydantic-1.7.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b11fc9530bf0698c8014b2bdb3bbc50243e82a7fa2577c8cfba660bcc819e768"}, + {file = "pydantic-1.7.2-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:a3c274c49930dc047a75ecc865e435f3df89715c775db75ddb0186804d9b04d0"}, + {file = "pydantic-1.7.2-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:c68b5edf4da53c98bb1ccb556ae8f655575cb2e676aef066c12b08c724a3f1a1"}, + {file = "pydantic-1.7.2-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:95d4410c4e429480c736bba0db6cce5aaa311304aea685ebcf9ee47571bfd7c8"}, + {file = "pydantic-1.7.2-cp37-cp37m-win_amd64.whl", hash = "sha256:a2fc7bf77ed4a7a961d7684afe177ff59971828141e608f142e4af858e07dddc"}, + {file = "pydantic-1.7.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b9572c0db13c8658b4a4cb705dcaae6983aeb9842248b36761b3fbc9010b740f"}, + {file = "pydantic-1.7.2-cp38-cp38-manylinux1_i686.whl", hash = "sha256:f83f679e727742b0c465e7ef992d6da4a7e5268b8edd8fdaf5303276374bef52"}, + {file = "pydantic-1.7.2-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:e5fece30e80087d9b7986104e2ac150647ec1658c4789c89893b03b100ca3164"}, + {file = "pydantic-1.7.2-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:ce2d452961352ba229fe1e0b925b41c0c37128f08dddb788d0fd73fd87ea0f66"}, + {file = "pydantic-1.7.2-cp38-cp38-win_amd64.whl", hash = "sha256:fc21a37ff3f545de80b166e1735c4172b41b017948a3fb2d5e2f03c219eac50a"}, + {file = "pydantic-1.7.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c9760d1556ec59ff745f88269a8f357e2b7afc75c556b3a87b8dda5bc62da8ba"}, + {file = "pydantic-1.7.2-cp39-cp39-manylinux1_i686.whl", hash = "sha256:2c1673633ad1eea78b1c5c420a47cd48717d2ef214c8230d96ca2591e9e00958"}, + {file = "pydantic-1.7.2-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:388c0c26c574ff49bad7d0fd6ed82fbccd86a0473fa3900397d3354c533d6ebb"}, + {file = "pydantic-1.7.2-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:ab1d5e4d8de00575957e1c982b951bffaedd3204ddd24694e3baca3332e53a23"}, + {file = "pydantic-1.7.2-cp39-cp39-win_amd64.whl", hash = "sha256:f045cf7afb3352a03bc6cb993578a34560ac24c5d004fa33c76efec6ada1361a"}, + {file = "pydantic-1.7.2-py3-none-any.whl", hash = "sha256:6665f7ab7fbbf4d3c1040925ff4d42d7549a8c15fe041164adfe4fc2134d4cce"}, + {file = "pydantic-1.7.2.tar.gz", hash = "sha256:c8200aecbd1fb914e1bd061d71a4d1d79ecb553165296af0c14989b89e90d09b"}, +] +pygtrie = [ + {file = "pygtrie-2.4.1.tar.gz", hash = "sha256:4367b87d92eaf475107421dce0295a9d4d72156702908c96c430a426b654aee7"}, +] +python-dotenv = [ + {file = "python-dotenv-0.15.0.tar.gz", hash = "sha256:587825ed60b1711daea4832cf37524dfd404325b7db5e25ebe88c495c9f807a0"}, + {file = "python_dotenv-0.15.0-py2.py3-none-any.whl", hash = "sha256:0c8d1b80d1a1e91717ea7d526178e3882732420b03f08afea0406db6402e220e"}, +] +rfc3986 = [ + {file = "rfc3986-1.4.0-py2.py3-none-any.whl", hash = "sha256:af9147e9aceda37c91a05f4deb128d4b4b49d6b199775fd2d2927768abdc8f50"}, + {file = "rfc3986-1.4.0.tar.gz", hash = "sha256:112398da31a3344dc25dbf477d8df6cb34f9278a94fee2625d89e4514be8bb9d"}, +] +sniffio = [ + {file = "sniffio-1.2.0-py3-none-any.whl", hash = "sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663"}, + {file = "sniffio-1.2.0.tar.gz", hash = "sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de"}, +] +starlette = [ + {file = "starlette-0.13.4-py3-none-any.whl", hash = "sha256:0fb4b38d22945b46acb880fedee7ee143fd6c0542992501be8c45c0ed737dd1a"}, + {file = "starlette-0.13.4.tar.gz", hash = "sha256:04fe51d86fd9a594d9b71356ed322ccde5c9b448fc716ac74155e5821a922f8d"}, +] +uvicorn = [ + {file = "uvicorn-0.11.8-py3-none-any.whl", hash = "sha256:4b70ddb4c1946e39db9f3082d53e323dfd50634b95fd83625d778729ef1730ef"}, + {file = "uvicorn-0.11.8.tar.gz", hash = "sha256:46a83e371f37ea7ff29577d00015f02c942410288fb57def6440f2653fff1d26"}, +] +uvloop = [ + {file = "uvloop-0.14.0-cp35-cp35m-macosx_10_11_x86_64.whl", hash = "sha256:08b109f0213af392150e2fe6f81d33261bb5ce968a288eb698aad4f46eb711bd"}, + {file = "uvloop-0.14.0-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:4544dcf77d74f3a84f03dd6278174575c44c67d7165d4c42c71db3fdc3860726"}, + {file = "uvloop-0.14.0-cp36-cp36m-macosx_10_11_x86_64.whl", hash = "sha256:b4f591aa4b3fa7f32fb51e2ee9fea1b495eb75b0b3c8d0ca52514ad675ae63f7"}, + {file = "uvloop-0.14.0-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:f07909cd9fc08c52d294b1570bba92186181ca01fe3dc9ffba68955273dd7362"}, + {file = "uvloop-0.14.0-cp37-cp37m-macosx_10_11_x86_64.whl", hash = "sha256:afd5513c0ae414ec71d24f6f123614a80f3d27ca655a4fcf6cabe50994cc1891"}, + {file = "uvloop-0.14.0-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:e7514d7a48c063226b7d06617cbb12a14278d4323a065a8d46a7962686ce2e95"}, + {file = "uvloop-0.14.0-cp38-cp38-macosx_10_11_x86_64.whl", hash = "sha256:bcac356d62edd330080aed082e78d4b580ff260a677508718f88016333e2c9c5"}, + {file = "uvloop-0.14.0-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:4315d2ec3ca393dd5bc0b0089d23101276778c304d42faff5dc4579cb6caef09"}, + {file = "uvloop-0.14.0.tar.gz", hash = "sha256:123ac9c0c7dd71464f58f1b4ee0bbd81285d96cdda8bc3519281b8973e3a461e"}, +] +websockets = [ + {file = "websockets-8.1-cp36-cp36m-macosx_10_6_intel.whl", hash = "sha256:3762791ab8b38948f0c4d281c8b2ddfa99b7e510e46bd8dfa942a5fff621068c"}, + {file = "websockets-8.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:3db87421956f1b0779a7564915875ba774295cc86e81bc671631379371af1170"}, + {file = "websockets-8.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4f9f7d28ce1d8f1295717c2c25b732c2bc0645db3215cf757551c392177d7cb8"}, + {file = "websockets-8.1-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:295359a2cc78736737dd88c343cd0747546b2174b5e1adc223824bcaf3e164cb"}, + {file = "websockets-8.1-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:1d3f1bf059d04a4e0eb4985a887d49195e15ebabc42364f4eb564b1d065793f5"}, + {file = "websockets-8.1-cp36-cp36m-win32.whl", hash = "sha256:2db62a9142e88535038a6bcfea70ef9447696ea77891aebb730a333a51ed559a"}, + {file = "websockets-8.1-cp36-cp36m-win_amd64.whl", hash = "sha256:0e4fb4de42701340bd2353bb2eee45314651caa6ccee80dbd5f5d5978888fed5"}, + {file = "websockets-8.1-cp37-cp37m-macosx_10_6_intel.whl", hash = "sha256:9b248ba3dd8a03b1a10b19efe7d4f7fa41d158fdaa95e2cf65af5a7b95a4f989"}, + {file = "websockets-8.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:ce85b06a10fc65e6143518b96d3dca27b081a740bae261c2fb20375801a9d56d"}, + {file = "websockets-8.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:965889d9f0e2a75edd81a07592d0ced54daa5b0785f57dc429c378edbcffe779"}, + {file = "websockets-8.1-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:751a556205d8245ff94aeef23546a1113b1dd4f6e4d102ded66c39b99c2ce6c8"}, + {file = "websockets-8.1-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:3ef56fcc7b1ff90de46ccd5a687bbd13a3180132268c4254fc0fa44ecf4fc422"}, + {file = "websockets-8.1-cp37-cp37m-win32.whl", hash = "sha256:7ff46d441db78241f4c6c27b3868c9ae71473fe03341340d2dfdbe8d79310acc"}, + {file = "websockets-8.1-cp37-cp37m-win_amd64.whl", hash = "sha256:20891f0dddade307ffddf593c733a3fdb6b83e6f9eef85908113e628fa5a8308"}, + {file = "websockets-8.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c1ec8db4fac31850286b7cd3b9c0e1b944204668b8eb721674916d4e28744092"}, + {file = "websockets-8.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:5c01fd846263a75bc8a2b9542606927cfad57e7282965d96b93c387622487485"}, + {file = "websockets-8.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:9bef37ee224e104a413f0780e29adb3e514a5b698aabe0d969a6ba426b8435d1"}, + {file = "websockets-8.1-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:d705f8aeecdf3262379644e4b55107a3b55860eb812b673b28d0fbc347a60c55"}, + {file = "websockets-8.1-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:c8a116feafdb1f84607cb3b14aa1418424ae71fee131642fc568d21423b51824"}, + {file = "websockets-8.1-cp38-cp38-win32.whl", hash = "sha256:e898a0863421650f0bebac8ba40840fc02258ef4714cb7e1fd76b6a6354bda36"}, + {file = "websockets-8.1-cp38-cp38-win_amd64.whl", hash = "sha256:f8a7bff6e8664afc4e6c28b983845c5bc14965030e3fb98789734d416af77c4b"}, + {file = "websockets-8.1.tar.gz", hash = "sha256:5c65d2da8c6bce0fca2528f69f44b2f977e06954c8512a952222cea50dad430f"}, +] +win32-setctime = [ + {file = "win32_setctime-1.0.3-py3-none-any.whl", hash = "sha256:dc925662de0a6eb987f0b01f599c01a8236cb8c62831c22d9cada09ad958243e"}, + {file = "win32_setctime-1.0.3.tar.gz", hash = "sha256:4e88556c32fdf47f64165a2180ba4552f8bb32c1103a2fafd05723a0bd42bd4b"}, +] diff --git a/packages/nonebot-plugin-docs/pyproject.toml b/packages/nonebot-plugin-docs/pyproject.toml new file mode 100644 index 00000000..6ef0f3b5 --- /dev/null +++ b/packages/nonebot-plugin-docs/pyproject.toml @@ -0,0 +1,17 @@ +[tool.poetry] +name = "nonebot-plugin-docs" +version = "0.1.0" +description = "View NoneBot2 Docs Locally" +authors = ["yanyongyu "] +license = "MIT" +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.7" +nonebot2 = "^2.0.0-alpha.1" + +[tool.poetry.dev-dependencies] + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" From 8f4961613d38daa9ab5775927345cbccfee4dc11 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sun, 22 Nov 2020 01:25:13 +0800 Subject: [PATCH 03/34] :construction_worker: update pull upstream ci --- .github/pull.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/pull.yml b/.github/pull.yml index 76879bce..ce40fd76 100644 --- a/.github/pull.yml +++ b/.github/pull.yml @@ -4,13 +4,14 @@ rules: # Array of rules upstream: nonebot:master # Required. Must be in the same fork network. mergeMethod: rebase # Optional, one of [none, merge, squash, rebase, hardreset], Default: none. mergeUnstable: false # Optional, merge pull request even when the mergeable_state is not clean. Default: false - - base: dev - upstream: nonebot:dev # Required. Can be a branch in the same forked repo. assignees: # Optional - yanyongyu reviewers: # Optional - yanyongyu conflictReviewers: # Optional, on merge conflict assign a reviewer - yanyongyu + - base: dev + upstream: nonebot:dev # Required. Can be a branch in the same forked repo. + mergeMethod: hardreset label: ":arrow_heading_down: pull" # Optional conflictLabel: "merge-conflict" # Optional, on merge conflict assign a custom label, Default: merge-conflict From 1557158cd904349c47aed37cbca85a1a01107bc0 Mon Sep 17 00:00:00 2001 From: synodriver <624805065@qq.com> Date: Thu, 19 Nov 2020 13:07:02 +0800 Subject: [PATCH 04/34] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86at=E6=9C=BA?= =?UTF-8?q?=E5=99=A8=E4=BA=BA=E6=97=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot/adapters/cqhttp/__init__.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/nonebot/adapters/cqhttp/__init__.py b/nonebot/adapters/cqhttp/__init__.py index 88b71820..f6e91681 100644 --- a/nonebot/adapters/cqhttp/__init__.py +++ b/nonebot/adapters/cqhttp/__init__.py @@ -112,14 +112,14 @@ async def _check_reply(bot: "Bot", event: "Event"): return msg_seg = event.message[index] event.reply = await bot.get_msg(message_id=msg_seg.data["id"]) - if event.reply["sender"]["user_id"] == event.self_id: + if event.reply["sender"]["user_id"] == int(event.self_id): # TODO 这里一个int一个str需要修改 event.to_me = True del event.message[index] if not event.message: event.message.append(MessageSegment.text("")) -def _check_at_me(bot: "Bot", event: "Event"): +def _check_at_me(bot: "Bot", event: "Event"): # TODO 只有开头at机器人才会识别,其他的不管 应该删除前面两个如果存在的at以及后面正文前面的空格 """ :说明: @@ -138,8 +138,8 @@ def _check_at_me(bot: "Bot", event: "Event"): else: at_me_seg = MessageSegment.at(event.self_id) - # check the first segment - if event.message[0] == at_me_seg: + # check the first segment at 空 at + if event.message[0] == at_me_seg: # TODO 有时候不能正常判断 event.to_me = True del event.message[0] if event.message[0].type == "text": @@ -147,13 +147,14 @@ def _check_at_me(bot: "Bot", event: "Event"): "text"].lstrip() if not event.message[0].data["text"]: del event.message[0] - if event.message[0] == at_me_seg: - del event.message[0] - if event.message[0].type == "text": - event.message[0].data["text"] = event.message[0].data[ - "text"].lstrip() - if not event.message[0].data["text"]: - del event.message[0] + if event.message: + if event.message[0] == at_me_seg: + del event.message[0] + if event.message[0].type == "text": + event.message[0].data["text"] = event.message[0].data[ + "text"].lstrip() + if not event.message[0].data["text"]: + del event.message[0] if not event.to_me: # check the last segment From 47aede8f6795f53fcc44e9b9c90dba92b44e2eba Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Thu, 19 Nov 2020 13:57:49 +0800 Subject: [PATCH 05/34] :bug: fix index error when check to me --- nonebot/adapters/cqhttp/__init__.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/nonebot/adapters/cqhttp/__init__.py b/nonebot/adapters/cqhttp/__init__.py index f6e91681..546fe862 100644 --- a/nonebot/adapters/cqhttp/__init__.py +++ b/nonebot/adapters/cqhttp/__init__.py @@ -112,14 +112,15 @@ async def _check_reply(bot: "Bot", event: "Event"): return msg_seg = event.message[index] event.reply = await bot.get_msg(message_id=msg_seg.data["id"]) - if event.reply["sender"]["user_id"] == int(event.self_id): # TODO 这里一个int一个str需要修改 + # ensure string comparation + if str(event.reply["sender"]["user_id"]) == str(event.self_id): event.to_me = True del event.message[index] if not event.message: event.message.append(MessageSegment.text("")) -def _check_at_me(bot: "Bot", event: "Event"): # TODO 只有开头at机器人才会识别,其他的不管 应该删除前面两个如果存在的at以及后面正文前面的空格 +def _check_at_me(bot: "Bot", event: "Event"): """ :说明: @@ -138,23 +139,22 @@ def _check_at_me(bot: "Bot", event: "Event"): # TODO 只有开头at机器人才 else: at_me_seg = MessageSegment.at(event.self_id) - # check the first segment at 空 at - if event.message[0] == at_me_seg: # TODO 有时候不能正常判断 + # check the first segment + if event.message[0] == at_me_seg: event.to_me = True del event.message[0] - if event.message[0].type == "text": + if event.message and event.message[0].type == "text": event.message[0].data["text"] = event.message[0].data[ "text"].lstrip() if not event.message[0].data["text"]: del event.message[0] - if event.message: - if event.message[0] == at_me_seg: - del event.message[0] - if event.message[0].type == "text": - event.message[0].data["text"] = event.message[0].data[ - "text"].lstrip() - if not event.message[0].data["text"]: - del event.message[0] + if event.message and event.message[0] == at_me_seg: + del event.message[0] + if event.message and event.message[0].type == "text": + event.message[0].data["text"] = event.message[0].data[ + "text"].lstrip() + if not event.message[0].data["text"]: + del event.message[0] if not event.to_me: # check the last segment From d726b75721f5c86616ded51a38e2c3731572be8c Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Thu, 19 Nov 2020 14:54:58 +0800 Subject: [PATCH 06/34] :memo: add changelog --- pages/changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/changelog.md b/pages/changelog.md index ef8bad8f..641a68c5 100644 --- a/pages/changelog.md +++ b/pages/changelog.md @@ -7,6 +7,7 @@ sidebar: auto ## v2.0.0a6 - 修复 block 失效问题 (hotfix) +- 修复 cqhttp 检查 to me 时出现 IndexError ## v2.0.0a5 From 557054cb8b2da9223241d395d408c90ee6610f37 Mon Sep 17 00:00:00 2001 From: Muchan Date: Thu, 19 Nov 2020 20:53:28 +0800 Subject: [PATCH 07/34] =?UTF-8?q?feat(message):=20=E4=BC=A0=E9=80=92matche?= =?UTF-8?q?r=E6=8A=9B=E5=87=BA=E7=9A=84StopPropagation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot/message.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nonebot/message.py b/nonebot/message.py index 90af9a96..ffd26b81 100644 --- a/nonebot/message.py +++ b/nonebot/message.py @@ -149,6 +149,8 @@ async def _run_matcher(Matcher: Type[Matcher], bot: Bot, event: Event, try: logger.debug(f"Running matcher {matcher}") await matcher.run(bot, event, state) + except StopPropagation as e: + exception = e except Exception as e: logger.opt(colors=True, exception=e).error( f"Running matcher {matcher} failed." @@ -166,7 +168,7 @@ async def _run_matcher(Matcher: Type[Matcher], bot: Bot, event: Event, "Error when running RunPostProcessors" ) - if matcher.block: + if matcher.block or isinstance(exception, StopPropagation): raise StopPropagation From 829f47c5e78abd53fb4d473a9db2fb4c096b90de Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Thu, 19 Nov 2020 21:21:54 +0800 Subject: [PATCH 08/34] :bug: fix #66 resolve reply message --- nonebot/adapters/cqhttp/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nonebot/adapters/cqhttp/__init__.py b/nonebot/adapters/cqhttp/__init__.py index 546fe862..5f2c8b09 100644 --- a/nonebot/adapters/cqhttp/__init__.py +++ b/nonebot/adapters/cqhttp/__init__.py @@ -116,6 +116,8 @@ async def _check_reply(bot: "Bot", event: "Event"): if str(event.reply["sender"]["user_id"]) == str(event.self_id): event.to_me = True del event.message[index] + if len(event.message) > index and event.message[index].type == "at": + del event.message[index] if not event.message: event.message.append(MessageSegment.text("")) From 17747f94c8aeed45a0bc4bd8676ac941c22f8e44 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Thu, 19 Nov 2020 22:04:44 +0800 Subject: [PATCH 09/34] :bug: fix #69 stop running expired matcher --- nonebot/message.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nonebot/message.py b/nonebot/message.py index ffd26b81..76f14b25 100644 --- a/nonebot/message.py +++ b/nonebot/message.py @@ -92,8 +92,9 @@ async def _check_matcher(priority: int, bot: Bot, event: Event, async def _check(Matcher: Type[Matcher], bot: Bot, event: Event, state: dict) -> Optional[Type[Matcher]]: try: - if await Matcher.check_perm( - bot, event) and await Matcher.check_rule(bot, event, state): + if (Matcher.expire_time and datetime.now() <= Matcher.expire_time + ) and await Matcher.check_perm( + bot, event) and await Matcher.check_rule(bot, event, state): return Matcher except Exception as e: logger.opt(colors=True, exception=e).error( From d55459cfcde7bf2fb1c2afddd762d0340bb349ac Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Thu, 19 Nov 2020 23:18:03 +0800 Subject: [PATCH 10/34] :ambulance: fix matcher check --- nonebot/message.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nonebot/message.py b/nonebot/message.py index 76f14b25..1b102633 100644 --- a/nonebot/message.py +++ b/nonebot/message.py @@ -92,7 +92,7 @@ async def _check_matcher(priority: int, bot: Bot, event: Event, async def _check(Matcher: Type[Matcher], bot: Bot, event: Event, state: dict) -> Optional[Type[Matcher]]: try: - if (Matcher.expire_time and datetime.now() <= Matcher.expire_time + if (not Matcher.expire_time or datetime.now() <= Matcher.expire_time ) and await Matcher.check_perm( bot, event) and await Matcher.check_rule(bot, event, state): return Matcher From 9241f4df79d94749c85595263fc6845c53a3cbb0 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Fri, 20 Nov 2020 01:07:24 +0800 Subject: [PATCH 11/34] :bug: fix remain space after reply --- nonebot/adapters/cqhttp/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nonebot/adapters/cqhttp/__init__.py b/nonebot/adapters/cqhttp/__init__.py index 5f2c8b09..92d118af 100644 --- a/nonebot/adapters/cqhttp/__init__.py +++ b/nonebot/adapters/cqhttp/__init__.py @@ -118,6 +118,9 @@ async def _check_reply(bot: "Bot", event: "Event"): del event.message[index] if len(event.message) > index and event.message[index].type == "at": del event.message[index] + if len(event.message) > index and event.message[index].type == "test": + event.message[index].data["text"] = event.message[index].data[ + "text"].strip() if not event.message: event.message.append(MessageSegment.text("")) From 5fb97998072bab6ca8935d44901fa9e934cf53cf Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Fri, 20 Nov 2020 01:37:53 +0800 Subject: [PATCH 12/34] :pencil2: fix typo --- nonebot/adapters/cqhttp/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nonebot/adapters/cqhttp/__init__.py b/nonebot/adapters/cqhttp/__init__.py index 92d118af..d67184fe 100644 --- a/nonebot/adapters/cqhttp/__init__.py +++ b/nonebot/adapters/cqhttp/__init__.py @@ -118,7 +118,7 @@ async def _check_reply(bot: "Bot", event: "Event"): del event.message[index] if len(event.message) > index and event.message[index].type == "at": del event.message[index] - if len(event.message) > index and event.message[index].type == "test": + if len(event.message) > index and event.message[index].type == "text": event.message[index].data["text"] = event.message[index].data[ "text"].strip() if not event.message: From e5213eb95a27d5632e87cfab24b8a7c476912f51 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Fri, 20 Nov 2020 12:53:31 +0800 Subject: [PATCH 13/34] :ambulance: fix not delete empty text --- nonebot/adapters/cqhttp/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nonebot/adapters/cqhttp/__init__.py b/nonebot/adapters/cqhttp/__init__.py index d67184fe..714e9f62 100644 --- a/nonebot/adapters/cqhttp/__init__.py +++ b/nonebot/adapters/cqhttp/__init__.py @@ -118,9 +118,11 @@ async def _check_reply(bot: "Bot", event: "Event"): del event.message[index] if len(event.message) > index and event.message[index].type == "at": del event.message[index] - if len(event.message) > index and event.message[index].type == "text": - event.message[index].data["text"] = event.message[index].data[ - "text"].strip() + if len(event.message) > index and event.message[index].type == "text": + event.message[index].data["text"] = event.message[index].data[ + "text"].lstrip() + if not event.message[index].data["text"]: + del event.message[index] if not event.message: event.message.append(MessageSegment.text("")) From 1aba139136d0a98f1f5b661ded1b219b30e4a918 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sat, 21 Nov 2020 18:33:35 +0800 Subject: [PATCH 14/34] :sparkles: get plugin func --- nonebot/__init__.py | 3 ++- nonebot/plugin.py | 14 +++++++++++++- nonebot/plugin.pyi | 4 ++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/nonebot/__init__.py b/nonebot/__init__.py index c704479e..61f7b9a9 100644 --- a/nonebot/__init__.py +++ b/nonebot/__init__.py @@ -239,4 +239,5 @@ async def _start_scheduler(): from nonebot.plugin import on_message, on_notice, on_request, on_metaevent, CommandGroup from nonebot.plugin import on_startswith, on_endswith, on_keyword, on_command, on_regex -from nonebot.plugin import load_plugin, load_plugins, load_builtin_plugins, get_loaded_plugins +from nonebot.plugin import load_plugin, load_plugins, load_builtin_plugins +from nonebot.plugin import get_plugin, get_loaded_plugins diff --git a/nonebot/plugin.py b/nonebot/plugin.py index 32be4dbc..d9aba299 100644 --- a/nonebot/plugin.py +++ b/nonebot/plugin.py @@ -459,10 +459,22 @@ def load_builtin_plugins() -> Optional[Plugin]: return load_plugin("nonebot.plugins.base") +def get_plugin(name: str) -> Optional[Plugin]: + """ + :说明: + 获取当前导入的某个插件。 + :参数: + * ``name: str``: 插件名,与 ``load_plugin`` 参数一致。如果为 ``load_plugins`` 导入的插件,则为文件(夹)名。 + :返回: + - ``Optional[Plugin]`` + """ + return plugins.get(name) + + def get_loaded_plugins() -> Set[Plugin]: """ :说明: - 获取当前已导入的插件。 + 获取当前已导入的所有插件。 :返回: - ``Set[Plugin]`` """ diff --git a/nonebot/plugin.pyi b/nonebot/plugin.pyi index 6cf93b97..68bb41fd 100644 --- a/nonebot/plugin.pyi +++ b/nonebot/plugin.pyi @@ -141,6 +141,10 @@ def load_builtin_plugins(): ... +def get_plugin(name: str) -> Optional[Plugin]: + ... + + def get_loaded_plugins() -> Set[Plugin]: ... From 689180ebe8a5b97d8f4ea20d80a0a37bc0ea101c Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sat, 21 Nov 2020 20:37:44 +0800 Subject: [PATCH 15/34] :memo: update change log --- pages/changelog.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/changelog.md b/pages/changelog.md index 641a68c5..c64953d6 100644 --- a/pages/changelog.md +++ b/pages/changelog.md @@ -4,10 +4,15 @@ sidebar: auto # 更新日志 +## v2.0.0a7 + +- 修复 cqhttp 检查 to me 时出现 IndexError +- 修复已失效的事件响应器仍会运行一次的 bug +- 修改 cqhttp 检查 reply 时未去除后续 at 以及空格 + ## v2.0.0a6 - 修复 block 失效问题 (hotfix) -- 修复 cqhttp 检查 to me 时出现 IndexError ## v2.0.0a5 From 2b10f81326d72c668f18c5e7c9d9c34bc7a1a60b Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sat, 21 Nov 2020 20:40:09 +0800 Subject: [PATCH 16/34] :alembic: add export require option --- nonebot/__init__.py | 2 +- nonebot/plugin.py | 136 ++++++++++++++++++++++-------- nonebot/plugin.pyi | 25 +++++- pages/changelog.md | 2 + tests/bot.py | 2 + tests/test_plugins/test_export.py | 15 ++++ 6 files changed, 145 insertions(+), 37 deletions(-) create mode 100644 tests/test_plugins/test_export.py diff --git a/nonebot/__init__.py b/nonebot/__init__.py index 61f7b9a9..312a8c67 100644 --- a/nonebot/__init__.py +++ b/nonebot/__init__.py @@ -240,4 +240,4 @@ async def _start_scheduler(): from nonebot.plugin import on_message, on_notice, on_request, on_metaevent, CommandGroup from nonebot.plugin import on_startswith, on_endswith, on_keyword, on_command, on_regex from nonebot.plugin import load_plugin, load_plugins, load_builtin_plugins -from nonebot.plugin import get_plugin, get_loaded_plugins +from nonebot.plugin import export, require, get_plugin, get_loaded_plugins diff --git a/nonebot/plugin.py b/nonebot/plugin.py index d9aba299..fd9195b7 100644 --- a/nonebot/plugin.py +++ b/nonebot/plugin.py @@ -11,6 +11,7 @@ import pkgutil import importlib from dataclasses import dataclass from importlib._bootstrap import _load +from contextvars import Context, ContextVar, copy_context from nonebot.log import logger from nonebot.matcher import Matcher @@ -25,7 +26,45 @@ plugins: Dict[str, "Plugin"] = {} :说明: 已加载的插件 """ -_tmp_matchers: Set[Type[Matcher]] = set() +_tmp_matchers: ContextVar[Set[Type[Matcher]]] = ContextVar("_tmp_matchers") +_export: ContextVar["Export"] = ContextVar("_export") + + +class Export(dict): + """ + :说明: + 插件导出内容以使得其他插件可以获得。 + :示例: + + .. code-block:: python + + nonebot.export().default = "bar" + + @nonebot.export() + def some_function(): + pass + + @nonebot.export().sub + def something_else(): + pass + """ + + def __call__(self, func, **kwargs): + self[func.__name__] = func + self.update(kwargs) + return func + + def __setitem__(self, key, value): + super().__setitem__(key, + Export(value) if isinstance(value, dict) else value) + + def __setattr__(self, name, value): + self[name] = Export(value) if isinstance(value, dict) else value + + def __getattr__(self, name): + if name not in self: + self[name] = Export() + return self[name] @dataclass(eq=False) @@ -46,6 +85,7 @@ class Plugin(object): - **类型**: ``Set[Type[Matcher]]`` - **说明**: 插件内定义的 ``Matcher`` """ + export: Export def on(type: str = "", @@ -80,7 +120,7 @@ def on(type: str = "", block=block, handlers=handlers, default_state=state) - _tmp_matchers.add(matcher) + _tmp_matchers.get().add(matcher) return matcher @@ -112,7 +152,7 @@ def on_metaevent(rule: Optional[Union[Rule, RuleChecker]] = None, block=block, handlers=handlers, default_state=state) - _tmp_matchers.add(matcher) + _tmp_matchers.get().add(matcher) return matcher @@ -146,7 +186,7 @@ def on_message(rule: Optional[Union[Rule, RuleChecker]] = None, block=block, handlers=handlers, default_state=state) - _tmp_matchers.add(matcher) + _tmp_matchers.get().add(matcher) return matcher @@ -178,7 +218,7 @@ def on_notice(rule: Optional[Union[Rule, RuleChecker]] = None, block=block, handlers=handlers, default_state=state) - _tmp_matchers.add(matcher) + _tmp_matchers.get().add(matcher) return matcher @@ -210,7 +250,7 @@ def on_request(rule: Optional[Union[Rule, RuleChecker]] = None, block=block, handlers=handlers, default_state=state) - _tmp_matchers.add(matcher) + _tmp_matchers.get().add(matcher) return matcher @@ -387,27 +427,35 @@ def load_plugin(module_path: str) -> Optional[Plugin]: :返回: - ``Optional[Plugin]`` """ - try: - _tmp_matchers.clear() - if module_path in plugins: - return plugins[module_path] - elif module_path in sys.modules: - logger.warning( - f"Module {module_path} has been loaded by other plugins! Ignored" + + def _load_plugin(module_path: str) -> Optional[Plugin]: + try: + _tmp_matchers.set(set()) + _export.set(Export()) + if module_path in plugins: + return plugins[module_path] + elif module_path in sys.modules: + logger.warning( + f"Module {module_path} has been loaded by other plugins! Ignored" + ) + return + module = importlib.import_module(module_path) + for m in _tmp_matchers.get(): + m.module = module_path + plugin = Plugin(module_path, module, _tmp_matchers.get(), + _export.get()) + plugins[module_path] = plugin + logger.opt( + colors=True).info(f'Succeeded to import "{module_path}"') + return plugin + except Exception as e: + logger.opt(colors=True, exception=e).error( + f'Failed to import "{module_path}"' ) - return - module = importlib.import_module(module_path) - for m in _tmp_matchers: - m.module = module_path - plugin = Plugin(module_path, module, _tmp_matchers.copy()) - plugins[module_path] = plugin - logger.opt( - colors=True).info(f'Succeeded to import "{module_path}"') - return plugin - except Exception as e: - logger.opt(colors=True, exception=e).error( - f'Failed to import "{module_path}"') - return None + return None + + context: Context = copy_context() + return context.run(_load_plugin, module_path) def load_plugins(*plugin_dir: str) -> Set[Plugin]: @@ -419,33 +467,42 @@ def load_plugins(*plugin_dir: str) -> Set[Plugin]: :返回: - ``Set[Plugin]`` """ - loaded_plugins = set() - for module_info in pkgutil.iter_modules(plugin_dir): - _tmp_matchers.clear() + + def _load_plugin(module_info) -> Optional[Plugin]: + _tmp_matchers.set(set()) + _export.set(Export()) name = module_info.name if name.startswith("_"): - continue + return spec = module_info.module_finder.find_spec(name, None) if spec.name in plugins: - continue + return elif spec.name in sys.modules: logger.warning( f"Module {spec.name} has been loaded by other plugin! Ignored") - continue + return try: module = _load(spec) - for m in _tmp_matchers: + for m in _tmp_matchers.get(): m.module = name - plugin = Plugin(name, module, _tmp_matchers.copy()) + plugin = Plugin(name, module, _tmp_matchers.get(), _export.get()) plugins[name] = plugin - loaded_plugins.add(plugin) logger.opt(colors=True).info(f'Succeeded to import "{name}"') + return plugin except Exception as e: logger.opt(colors=True, exception=e).error( f'Failed to import "{name}"') + return None + + loaded_plugins = set() + for module_info in pkgutil.iter_modules(plugin_dir): + context: Context = copy_context() + result = context.run(_load_plugin, module_info) + if result: + loaded_plugins.add(result) return loaded_plugins @@ -479,3 +536,12 @@ def get_loaded_plugins() -> Set[Plugin]: - ``Set[Plugin]`` """ return set(plugins.values()) + + +def export() -> Export: + return _export.get() + + +def require(name: str) -> Optional[Export]: + plugin = get_plugin(name) + return plugin.export if plugin else None diff --git a/nonebot/plugin.pyi b/nonebot/plugin.pyi index 68bb41fd..37d775d6 100644 --- a/nonebot/plugin.pyi +++ b/nonebot/plugin.pyi @@ -1,17 +1,32 @@ import re +from contextvars import ContextVar from nonebot.typing import Rule, Matcher, Handler, Permission, RuleChecker from nonebot.typing import Set, List, Dict, Type, Tuple, Union, Optional, ModuleType plugins: Dict[str, "Plugin"] = ... -_tmp_matchers: Set[Type[Matcher]] = ... +_tmp_matchers: ContextVar[Set[Type[Matcher]]] = ... +_export: ContextVar["Export"] = ... + + +class Export(dict): + + def __call__(self, func, **kwargs): + ... + + def __setattr__(self, name, value): + ... + + def __getattr__(self, name): + ... class Plugin(object): name: str module: ModuleType matcher: Set[Type[Matcher]] + export: Export def on(type: str = ..., @@ -149,6 +164,14 @@ def get_loaded_plugins() -> Set[Plugin]: ... +def export() -> Export: + ... + + +def require(name: str) -> Export: + ... + + class CommandGroup: def __init__(self, diff --git a/pages/changelog.md b/pages/changelog.md index c64953d6..859be509 100644 --- a/pages/changelog.md +++ b/pages/changelog.md @@ -9,6 +9,8 @@ sidebar: auto - 修复 cqhttp 检查 to me 时出现 IndexError - 修复已失效的事件响应器仍会运行一次的 bug - 修改 cqhttp 检查 reply 时未去除后续 at 以及空格 +- 添加 get_plugin 获取插件函数 +- 添加插件 export, require 方法 ## v2.0.0a6 diff --git a/tests/bot.py b/tests/bot.py index 7a294564..68a4e399 100644 --- a/tests/bot.py +++ b/tests/bot.py @@ -22,6 +22,8 @@ nonebot.load_builtin_plugins() # load local plugins nonebot.load_plugins("test_plugins") +print(nonebot.require("test_export")) + # modify some config / config depends on loaded configs config = nonebot.get_driver().config config.custom_config3 = config.custom_config1 diff --git a/tests/test_plugins/test_export.py b/tests/test_plugins/test_export.py new file mode 100644 index 00000000..ec549571 --- /dev/null +++ b/tests/test_plugins/test_export.py @@ -0,0 +1,15 @@ +import nonebot + +export = nonebot.export() +export.foo = "bar" +export["bar"] = "foo" + + +@export +def a(): + pass + + +@export.sub +def b(): + pass From 9a819fc12c4e86e6e883e593b891433c48bce321 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sat, 21 Nov 2020 20:50:33 +0800 Subject: [PATCH 17/34] :bulb: update docstring --- docs/api/nonebot.md | 9 ++++ docs/api/plugin.md | 104 +++++++++++++++++++++++++++++++++++++++++++- nonebot/__init__.py | 3 ++ nonebot/plugin.py | 22 ++++++++++ 4 files changed, 137 insertions(+), 1 deletion(-) diff --git a/docs/api/nonebot.md b/docs/api/nonebot.md index cdb72bdb..68708c95 100644 --- a/docs/api/nonebot.md +++ b/docs/api/nonebot.md @@ -49,9 +49,18 @@ sidebarDepth: 0 * `load_builtin_plugins` => `nonebot.plugin.load_builtin_plugins` +* `get_plugin` => `nonebot.plugin.get_plugin` + + * `get_loaded_plugins` => `nonebot.plugin.get_loaded_plugins` +* `export` => `nonebot.plugin.export` + + +* `require` => `nonebot.plugin.require` + + ## `get_driver()` diff --git a/docs/api/plugin.md b/docs/api/plugin.md index 42cdf84f..5f7a7d46 100644 --- a/docs/api/plugin.md +++ b/docs/api/plugin.md @@ -25,6 +25,37 @@ sidebarDepth: 0 +## _class_ `Export` + +基类:`dict` + + +* **说明** + + 插件导出内容以使得其他插件可以获得。 + + + +* **示例** + + +```python +nonebot.export().default = "bar" + +@nonebot.export() +def some_function(): + pass + +# this don't work under python 3.9 +# use +# export = nonebot.export(); @export.sub +# instead +@nonebot.export().sub +def something_else(): + pass +``` + + ## _class_ `Plugin` 基类:`object` @@ -59,6 +90,15 @@ sidebarDepth: 0 * **说明**: 插件内定义的 `Matcher` +### `export` + + +* **类型**: `Export` + + +* **说明**: 插件内定义的导出内容 + + ## `on(type='', rule=None, permission=None, *, handlers=None, temp=False, priority=1, block=False, state=None)` @@ -614,12 +654,35 @@ sidebarDepth: 0 +## `get_plugin(name)` + + +* **说明** + + 获取当前导入的某个插件。 + + + +* **参数** + + + * `name: str`: 插件名,与 `load_plugin` 参数一致。如果为 `load_plugins` 导入的插件,则为文件(夹)名。 + + + +* **返回** + + + * `Optional[Plugin]` + + + ## `get_loaded_plugins()` * **说明** - 获取当前已导入的插件。 + 获取当前已导入的所有插件。 @@ -627,3 +690,42 @@ sidebarDepth: 0 * `Set[Plugin]` + + + +## `export()` + + +* **说明** + + 获取插件的导出内容对象 + + + +* **返回** + + + * `Export` + + + +## `require(name)` + + +* **说明** + + 获取一个插件的导出内容 + + + +* **参数** + + + * `name: str`: 插件名,与 `load_plugin` 参数一致。如果为 `load_plugins` 导入的插件,则为文件(夹)名。 + + + +* **返回** + + + * `Optional[Export]` diff --git a/nonebot/__init__.py b/nonebot/__init__.py index 312a8c67..d642ff44 100644 --- a/nonebot/__init__.py +++ b/nonebot/__init__.py @@ -17,7 +17,10 @@ - ``load_plugin`` => ``nonebot.plugin.load_plugin`` - ``load_plugins`` => ``nonebot.plugin.load_plugins`` - ``load_builtin_plugins`` => ``nonebot.plugin.load_builtin_plugins`` +- ``get_plugin`` => ``nonebot.plugin.get_plugin`` - ``get_loaded_plugins`` => ``nonebot.plugin.get_loaded_plugins`` +- ``export`` => ``nonebot.plugin.export`` +- ``require`` => ``nonebot.plugin.require`` """ import importlib diff --git a/nonebot/plugin.py b/nonebot/plugin.py index fd9195b7..f063726c 100644 --- a/nonebot/plugin.py +++ b/nonebot/plugin.py @@ -44,6 +44,10 @@ class Export(dict): def some_function(): pass + # this don't work under python 3.9 + # use + # export = nonebot.export(); @export.sub + # instead @nonebot.export().sub def something_else(): pass @@ -86,6 +90,10 @@ class Plugin(object): - **说明**: 插件内定义的 ``Matcher`` """ export: Export + """ + - **类型**: ``Export`` + - **说明**: 插件内定义的导出内容 + """ def on(type: str = "", @@ -539,9 +547,23 @@ def get_loaded_plugins() -> Set[Plugin]: def export() -> Export: + """ + :说明: + 获取插件的导出内容对象 + :返回: + - ``Export`` + """ return _export.get() def require(name: str) -> Optional[Export]: + """ + :说明: + 获取一个插件的导出内容 + :参数: + * ``name: str``: 插件名,与 ``load_plugin`` 参数一致。如果为 ``load_plugins`` 导入的插件,则为文件(夹)名。 + :返回: + - ``Optional[Export]`` + """ plugin = get_plugin(name) return plugin.export if plugin else None From 68ed443fa341c2834e01c2bbc79f0fd1008e2a93 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sun, 22 Nov 2020 01:51:23 +0800 Subject: [PATCH 18/34] :alien: update vuepress base --- docs/.vuepress/config.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index 8faed7a5..e339e2ca 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,6 +1,7 @@ const path = require("path"); module.exports = context => ({ + base: process.env.VUEPRESS_BASE || "/", title: "NoneBot", description: "基于 酷Q 的 Python 异步 QQ 机器人框架", markdown: { @@ -117,12 +118,7 @@ module.exports = context => ({ title: "进阶", collapsable: false, sidebar: "auto", - children: [ - "", - "scheduler", - "permission", - "runtime-hook" - ] + children: ["", "scheduler", "permission", "runtime-hook"] } ], "/api/": [ From 389211f740b38dbf6fda86beb3a79f9f5eb1b93f Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sun, 22 Nov 2020 02:17:13 +0800 Subject: [PATCH 19/34] :bug: fix error arg --- .../nonebot_plugin_docs/drivers/fastapi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py b/packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py index 217decea..79c2f4fe 100644 --- a/packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py +++ b/packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py @@ -4,7 +4,7 @@ @Author : yanyongyu @Date : 2020-11-22 00:56:31 @LastEditors : yanyongyu -@LastEditTime : 2020-11-22 01:03:05 +@LastEditTime : 2020-11-22 02:16:42 @Description : None @GitHub : https://github.com/yanyongyu """ @@ -16,7 +16,7 @@ from nonebot.drivers.fastapi import Driver from fastapi.staticfiles import StaticFiles -def register_route(driver: Driver, socketio): +def register_route(driver: Driver): app = driver.server_app static_path = str((Path(__file__).parent / ".." / "dist").resolve()) From b5b8ff165c9d7f5b758082cf6f74aefce671fb91 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sun, 22 Nov 2020 02:42:27 +0800 Subject: [PATCH 20/34] :construction_worker: add release ci --- .github/workflows/nonebot_plugin_docs.yml | 40 +++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/nonebot_plugin_docs.yml diff --git a/.github/workflows/nonebot_plugin_docs.yml b/.github/workflows/nonebot_plugin_docs.yml new file mode 100644 index 00000000..757ef41a --- /dev/null +++ b/.github/workflows/nonebot_plugin_docs.yml @@ -0,0 +1,40 @@ +name: Release Nonebot Plugin Docs + +on: + release: + types: [ published ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '12' + - run: npm ci + - name: Build Docs + env: + VUEPRESS_BASE: '/docs/' + run: npx vuepress build docs --dest packages/nonebot-plugin-docs/nonebot_plugin_docs/dist + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + architecture: "x64" + - name: Install Poetry + run: | + python -m pip install --upgrade pip + pip install poetry + + - name: Publish Package + run: | + export NONEBOT_VERSION=`poetry version -s` + cd packages/nonebot-plugin-docs/ + poetry version $NONEBOT_VERSION + poetry build + poetry publish -u ${{secrets.PYPI_USERNAME}} -p ${{secrets.PYPI_PASSWORD}} From 1affeb8e202ca41df79083ae0779b5c1fbe8dda4 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sun, 22 Nov 2020 03:05:28 +0800 Subject: [PATCH 21/34] :bookmark: release 2.0.0a6 --- packages/nonebot-plugin-docs/README.md | 29 ++++++++++++++++++++- packages/nonebot-plugin-docs/pyproject.toml | 7 ++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/packages/nonebot-plugin-docs/README.md b/packages/nonebot-plugin-docs/README.md index 463d5b92..88b9fcd3 100644 --- a/packages/nonebot-plugin-docs/README.md +++ b/packages/nonebot-plugin-docs/README.md @@ -2,7 +2,34 @@ * @Author : yanyongyu * @Date : 2020-11-22 01:19:19 * @LastEditors : yanyongyu - * @LastEditTime : 2020-11-22 01:19:20 + * @LastEditTime : 2020-11-22 02:51:14 * @Description : None * @GitHub : https://github.com/yanyongyu --> +

+ nonebot +

+ +
+ +# nonebot-plugin-docs + +_✨ NoneBot 本地文档插件 ✨_ + +
+ +

+ + license + + + pypi + + python +

+ +## 使用方式 + +加载插件并启动 Bot ,在浏览器内打开 `http://host:port/docs/`。 + +具体网址会在控制台内输出。 diff --git a/packages/nonebot-plugin-docs/pyproject.toml b/packages/nonebot-plugin-docs/pyproject.toml index 6ef0f3b5..f10445d1 100644 --- a/packages/nonebot-plugin-docs/pyproject.toml +++ b/packages/nonebot-plugin-docs/pyproject.toml @@ -1,10 +1,15 @@ [tool.poetry] name = "nonebot-plugin-docs" -version = "0.1.0" +version = "2.0.0-alpha.6" description = "View NoneBot2 Docs Locally" authors = ["yanyongyu "] license = "MIT" readme = "README.md" +homepage = "https://github.com/yanyongyu/nonebot2/blob/master/packages/nonebot-plugin-docs" +repository = "https://github.com/yanyongyu/nonebot2" +keywords = ["nonebot", "nonebot2", "docs"] +include = ["nonebot_plugin_docs/dist/**/*"] + [tool.poetry.dependencies] python = "^3.7" From f01295d936141f9d18da01f34e558d1f8fac027e Mon Sep 17 00:00:00 2001 From: nonebot Date: Sun, 22 Nov 2020 08:25:25 +0000 Subject: [PATCH 22/34] =?UTF-8?q?:beers:=20publish=20NoneBot=E7=A6=BB?= =?UTF-8?q?=E7=BA=BF=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/public/plugins.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/.vuepress/public/plugins.json b/docs/.vuepress/public/plugins.json index c6849fc4..0e8ade6d 100644 --- a/docs/.vuepress/public/plugins.json +++ b/docs/.vuepress/public/plugins.json @@ -22,5 +22,13 @@ "desc": "基于规则的授权管理", "author": "Lancercmd", "repo": "Lancercmd/nonebot_plugin_rauthman" + }, + { + "id": "nonebot_plugin_docs", + "link": "nonebot-plugin-docs", + "author": "nonebot", + "desc": "在本地浏览NoneBot文档", + "name": "NoneBot离线文档", + "repo": "yanyongyu/nonebot2/tree/master/packages/nonebot-plugin-docs" } -] +] \ No newline at end of file From 9d30f2dff3854e3752e60797ec8a40c047c3d3d8 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sun, 22 Nov 2020 16:40:06 +0800 Subject: [PATCH 23/34] :construction_worker: update release drafter --- .github/release-drafter.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index fcca4ea8..c77a0550 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -26,6 +26,10 @@ version-resolver: - 'patch' default: patch template: | - ## Changes + ## Documentation + + See: https://v2.nonebot.dev + + ## 💫 Changes $CHANGES From e92cbf2f50a22f033d3b619121eb021696c2bc7d Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sun, 22 Nov 2020 21:12:07 +0800 Subject: [PATCH 24/34] :bug: bump version due to vuepress base error --- packages/nonebot-plugin-docs/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nonebot-plugin-docs/pyproject.toml b/packages/nonebot-plugin-docs/pyproject.toml index f10445d1..cf72757b 100644 --- a/packages/nonebot-plugin-docs/pyproject.toml +++ b/packages/nonebot-plugin-docs/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "nonebot-plugin-docs" -version = "2.0.0-alpha.6" +version = "2.0.0a6.post1" description = "View NoneBot2 Docs Locally" authors = ["yanyongyu "] license = "MIT" From 0dddbedd70e28930a64019de40f4189efa89628f Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Mon, 23 Nov 2020 13:35:26 +0000 Subject: [PATCH 25/34] =?UTF-8?q?:beers:=20publish=20Sentry=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/.vuepress/public/plugins.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/.vuepress/public/plugins.json b/docs/.vuepress/public/plugins.json index 0e8ade6d..b5c5760b 100644 --- a/docs/.vuepress/public/plugins.json +++ b/docs/.vuepress/public/plugins.json @@ -30,5 +30,13 @@ "desc": "在本地浏览NoneBot文档", "name": "NoneBot离线文档", "repo": "yanyongyu/nonebot2/tree/master/packages/nonebot-plugin-docs" + }, + { + "id": "nonebot_plugin_sentry", + "link": "nonebot-plugin-sentry", + "author": "yanyongyu", + "desc": "使用Sentry监控机器人日志并处理报错", + "name": "Sentry日志监控", + "repo": "cscs181/QQ-GitHub-Bot/tree/master/src/plugins/nonebot_plugin_sentry" } ] \ No newline at end of file From 47d1fab4bda0f226a16162ece8a5a9d1ae1f5e21 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Mon, 23 Nov 2020 13:41:57 +0800 Subject: [PATCH 26/34] :memo: add cross plugin guide --- docs/.vuepress/config.js | 8 +++++++- docs/advanced/export-and-require.md | 1 + docs/advanced/permission.md | 2 +- docs/advanced/runtime-hook.md | 2 +- docs/advanced/scheduler.md | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 docs/advanced/export-and-require.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index e339e2ca..e4f24184 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -118,7 +118,13 @@ module.exports = context => ({ title: "进阶", collapsable: false, sidebar: "auto", - children: ["", "scheduler", "permission", "runtime-hook"] + children: [ + "", + "scheduler", + "permission", + "runtime-hook", + "export-and-require" + ] } ], "/api/": [ diff --git a/docs/advanced/export-and-require.md b/docs/advanced/export-and-require.md new file mode 100644 index 00000000..832b0e75 --- /dev/null +++ b/docs/advanced/export-and-require.md @@ -0,0 +1 @@ +# 跨插件访问 diff --git a/docs/advanced/permission.md b/docs/advanced/permission.md index 30e20002..7190bcdd 100644 --- a/docs/advanced/permission.md +++ b/docs/advanced/permission.md @@ -1 +1 @@ -# 权限控制 \ No newline at end of file +# 权限控制 diff --git a/docs/advanced/runtime-hook.md b/docs/advanced/runtime-hook.md index ed3968a4..58bca681 100644 --- a/docs/advanced/runtime-hook.md +++ b/docs/advanced/runtime-hook.md @@ -1 +1 @@ -# 运行时插槽 \ No newline at end of file +# 运行时插槽 diff --git a/docs/advanced/scheduler.md b/docs/advanced/scheduler.md index 99d906d3..53e6cedc 100644 --- a/docs/advanced/scheduler.md +++ b/docs/advanced/scheduler.md @@ -1 +1 @@ -# 定时任务 \ No newline at end of file +# 定时任务 From 39d96d966716868af90a3c9e48ccac6e2605811f Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Mon, 23 Nov 2020 13:46:36 +0800 Subject: [PATCH 27/34] :memo: add plugin publish guide --- docs/.vuepress/config.js | 8 ++++++++ docs/advanced/publish-plugin.md | 1 + 2 files changed, 9 insertions(+) create mode 100644 docs/advanced/publish-plugin.md diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index e4f24184..f7c87283 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -125,6 +125,14 @@ module.exports = context => ({ "runtime-hook", "export-and-require" ] + }, + { + title: "发布", + collapsable: false, + sidebar: "auto", + children: [ + "publish-plugin" + ] } ], "/api/": [ diff --git a/docs/advanced/publish-plugin.md b/docs/advanced/publish-plugin.md new file mode 100644 index 00000000..68e2e6f9 --- /dev/null +++ b/docs/advanced/publish-plugin.md @@ -0,0 +1 @@ +# 发布插件 From 168f366efc41c8e256030f2c167a3fe41be47ede Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Mon, 23 Nov 2020 14:15:30 +0800 Subject: [PATCH 28/34] :memo: update guide --- docs/guide/installation.md | 7 ++++--- docs/guide/loading-a-plugin.md | 11 +---------- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 907630c9..2b54eae1 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -44,7 +44,8 @@ pip install nonebot2[scheduler] poetry add nonebot2[scheduler] ``` -[View On GitHub](https://github.com/agronholm/apscheduler) +[![apscheduler](https://img.shields.io/github/stars/agronholm/apscheduler?style=social)](https://github.com/agronholm/apscheduler) + ### NoneBot-Test @@ -57,7 +58,7 @@ pip install nonebot2[test] poetry add nonebot2[test] ``` -[View On GitHub](https://github.com/nonebot/nonebot-test) +[![nonebot-test](https://img.shields.io/github/stars/nonebot/nonebot-test?style=social)](https://github.com/nonebot/nonebot-test) ### CLI @@ -70,7 +71,7 @@ pip install nonebot2[cli] poetry add nonebot2[cli] ``` -[View On GitHub](https://github.com/yanyongyu/nb-cli) +[![nb-cli](https://img.shields.io/github/stars/nonebot/nb-cli?style=social)](https://github.com/yanyongyu/nb-cli) ### 我全都要 diff --git a/docs/guide/loading-a-plugin.md b/docs/guide/loading-a-plugin.md index b648b4b6..2a3016d5 100644 --- a/docs/guide/loading-a-plugin.md +++ b/docs/guide/loading-a-plugin.md @@ -52,12 +52,7 @@ if __name__ == "__main__": ::: :::danger 警告 -插件间不应该存在过多的耦合,如果确实需要导入某个插件内的数据,可以使用如下两种方法: - -1. (推荐) `from plugin_name import xxx` 而非 `from awesome_bot.plugins.plugin_name import xxx` -2. 在需要导入其他插件的文件中添加 `__package__ = "plugins"; from .plugin_name import xxx` (将共同的上层目录设定为父包后使用相对导入) - -具体可以参考:[nonebot/nonebot2#32](https://github.com/nonebot/nonebot2/issues/32) +插件间不应该存在过多的耦合,如果确实需要导入某个插件内的数据,可以参考 [进阶-跨插件访问](../advanced/export-and-require.md) ::: ## 加载单个插件 @@ -113,10 +108,6 @@ _sub_plugins |= nonebot.load_plugins( 插件将会被加载并存储于 `_sub_plugins` 中。 -:::tip 提示 -如果在父插件中需要定义事件响应器,应在**子插件被加载后**进行定义 -::: - ## 运行结果 尝试运行 `nb run` 或者 `python bot.py`,可以看到日志输出了类似如下内容: From dc0c634eab5526f46eda2f07f94a3e5bc18c3ac6 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Thu, 26 Nov 2020 20:18:36 +0800 Subject: [PATCH 29/34] :bug: fix workflow vulnerability #79 --- .../{api_docs.yml => build_docs.yml} | 15 +++------ .github/workflows/upload_docs.yml | 33 +++++++++++++++++++ 2 files changed, 38 insertions(+), 10 deletions(-) rename .github/workflows/{api_docs.yml => build_docs.yml} (60%) create mode 100644 .github/workflows/upload_docs.yml diff --git a/.github/workflows/api_docs.yml b/.github/workflows/build_docs.yml similarity index 60% rename from .github/workflows/api_docs.yml rename to .github/workflows/build_docs.yml index f4ee792b..8f4b0dc2 100644 --- a/.github/workflows/api_docs.yml +++ b/.github/workflows/build_docs.yml @@ -1,7 +1,7 @@ name: Build API Doc on: - pull_request_target: + pull_request: types: [ opened, synchronize, reopened ] jobs: @@ -12,7 +12,6 @@ jobs: - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} - token: ${{ secrets.GH_TOKEN }} - name: Set up Python uses: actions/setup-python@v2 @@ -32,11 +31,7 @@ jobs: - name: Copy Files run: cp -r ./build/markdown/* ./docs/api/ - - run: | - git config user.name nonebot - git config user.email nonebot@nonebot.dev - git add . - git diff-index --quiet HEAD || git commit -m ":memo: update api docs" - git remote -vv - git remote add target ${{github.event.pull_request.head.repo.clone_url}} - git push target HEAD:${{github.event.pull_request.head.ref}} + - uses: actions/upload-artifact@v2 + with: + name: docs + path: docs/ diff --git a/.github/workflows/upload_docs.yml b/.github/workflows/upload_docs.yml new file mode 100644 index 00000000..d20c3677 --- /dev/null +++ b/.github/workflows/upload_docs.yml @@ -0,0 +1,33 @@ +name: Upload API Doc + +on: + workflow_run: + workflows: ["Build API Doc"] + types: + - completed + +jobs: + upload: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' }} + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.workflow_run.head_sha }} + token: ${{ secrets.GH_TOKEN }} + + - uses: dawidd6/action-download-artifact@v2 + with: + workflow: ${{ github.event.workflow_run.workflow_id }} + name: docs + path: docs/ + + - env: + REF: ${{ github.event.workflow_run.head_branch }} + run: | + git config user.name GitHub + git config user.email noreply@github.com + git add . + git diff-index --quiet HEAD || git commit -m ":memo: update api docs" + git remote add target "https://github.com/${{ github.event.workflow_run.head_repository.full_name }}.git" + git push target HEAD:$REF From ee80a4ea60fd64de4fdfe48ea6c8ecfbc5e1826d Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Thu, 26 Nov 2020 20:53:28 +0800 Subject: [PATCH 30/34] :construction_worker: update user info for pr --- .github/workflows/upload_docs.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/upload_docs.yml b/.github/workflows/upload_docs.yml index d20c3677..5b306c01 100644 --- a/.github/workflows/upload_docs.yml +++ b/.github/workflows/upload_docs.yml @@ -24,10 +24,12 @@ jobs: - env: REF: ${{ github.event.workflow_run.head_branch }} + PR_REPO: ${{ github.event.workflow_run.head_repository.full_name }} + PR_USER: ${{ github.event.workflow_run.head_repository.owner.login }} run: | - git config user.name GitHub - git config user.email noreply@github.com + git config user.name $PR_USER + git config user.email $PR_USER@users.noreply.github.com git add . git diff-index --quiet HEAD || git commit -m ":memo: update api docs" - git remote add target "https://github.com/${{ github.event.workflow_run.head_repository.full_name }}.git" + git remote add target https://github.com/$PR_REPO.git git push target HEAD:$REF From da5d63ae294f873aae5387c368dac3994f2b3970 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sat, 28 Nov 2020 11:43:13 +0800 Subject: [PATCH 31/34] :fire: remove useless pull and lock file --- .github/pull.yml | 17 - packages/nonebot-plugin-docs/poetry.lock | 398 ----------------------- 2 files changed, 415 deletions(-) delete mode 100644 .github/pull.yml delete mode 100644 packages/nonebot-plugin-docs/poetry.lock diff --git a/.github/pull.yml b/.github/pull.yml deleted file mode 100644 index ce40fd76..00000000 --- a/.github/pull.yml +++ /dev/null @@ -1,17 +0,0 @@ -version: "1" -rules: # Array of rules - - base: master # Required. Target branch - upstream: nonebot:master # Required. Must be in the same fork network. - mergeMethod: rebase # Optional, one of [none, merge, squash, rebase, hardreset], Default: none. - mergeUnstable: false # Optional, merge pull request even when the mergeable_state is not clean. Default: false - assignees: # Optional - - yanyongyu - reviewers: # Optional - - yanyongyu - conflictReviewers: # Optional, on merge conflict assign a reviewer - - yanyongyu - - base: dev - upstream: nonebot:dev # Required. Can be a branch in the same forked repo. - mergeMethod: hardreset -label: ":arrow_heading_down: pull" # Optional -conflictLabel: "merge-conflict" # Optional, on merge conflict assign a custom label, Default: merge-conflict diff --git a/packages/nonebot-plugin-docs/poetry.lock b/packages/nonebot-plugin-docs/poetry.lock deleted file mode 100644 index ae3f9365..00000000 --- a/packages/nonebot-plugin-docs/poetry.lock +++ /dev/null @@ -1,398 +0,0 @@ -[[package]] -name = "certifi" -version = "2020.11.8" -description = "Python package for providing Mozilla's CA Bundle." -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "click" -version = "7.1.2" -description = "Composable command line interface toolkit" -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[[package]] -name = "colorama" -version = "0.4.4" -description = "Cross-platform colored terminal text." -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - -[[package]] -name = "fastapi" -version = "0.58.1" -description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production" -category = "main" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -pydantic = ">=0.32.2,<2.0.0" -starlette = "0.13.4" - -[package.extras] -all = ["requests", "aiofiles", "jinja2", "python-multipart", "itsdangerous", "pyyaml", "graphene", "ujson", "orjson", "email-validator", "uvicorn", "async-exit-stack", "async-generator"] -dev = ["pyjwt", "passlib", "autoflake", "flake8", "uvicorn", "graphene"] -doc = ["mkdocs", "mkdocs-material", "markdown-include", "typer", "typer-cli", "pyyaml"] -test = ["pytest (==5.4.3)", "pytest-cov (==2.10.0)", "mypy", "black", "isort", "requests", "email-validator", "sqlalchemy", "peewee", "databases", "orjson", "async-exit-stack", "async-generator", "python-multipart", "aiofiles", "flask"] - -[[package]] -name = "h11" -version = "0.9.0" -description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "httpcore" -version = "0.12.2" -description = "A minimal low-level HTTP client." -category = "main" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -h11 = "<1.0.0" -sniffio = ">=1.0.0,<2.0.0" - -[package.extras] -http2 = ["h2 (>=3,<5)"] - -[[package]] -name = "httptools" -version = "0.1.1" -description = "A collection of framework independent HTTP protocol utils." -category = "main" -optional = false -python-versions = "*" - -[package.extras] -test = ["Cython (==0.29.14)"] - -[[package]] -name = "httpx" -version = "0.16.1" -description = "The next generation HTTP client." -category = "main" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -certifi = "*" -httpcore = ">=0.12.0,<0.13.0" -rfc3986 = {version = ">=1.3,<2", extras = ["idna2008"]} -sniffio = "*" - -[package.extras] -brotli = ["brotlipy (>=0.7.0,<0.8.0)"] -http2 = ["h2 (>=3.0.0,<4.0.0)"] - -[[package]] -name = "idna" -version = "2.10" -description = "Internationalized Domain Names in Applications (IDNA)" -category = "main" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" - -[[package]] -name = "loguru" -version = "0.5.3" -description = "Python logging made (stupidly) simple" -category = "main" -optional = false -python-versions = ">=3.5" - -[package.dependencies] -colorama = {version = ">=0.3.4", markers = "sys_platform == \"win32\""} -win32-setctime = {version = ">=1.0.0", markers = "sys_platform == \"win32\""} - -[package.extras] -dev = ["codecov (>=2.0.15)", "colorama (>=0.3.4)", "flake8 (>=3.7.7)", "tox (>=3.9.0)", "tox-travis (>=0.12)", "pytest (>=4.6.2)", "pytest-cov (>=2.7.1)", "Sphinx (>=2.2.1)", "sphinx-autobuild (>=0.7.1)", "sphinx-rtd-theme (>=0.4.3)", "black (>=19.10b0)", "isort (>=5.1.1)"] - -[[package]] -name = "nonebot2" -version = "2.0.0a6" -description = "An asynchronous python bot framework." -category = "main" -optional = false -python-versions = ">=3.7,<4.0" - -[package.dependencies] -fastapi = ">=0.58.1,<0.59.0" -httpx = ">=0.16.1,<0.17.0" -loguru = ">=0.5.1,<0.6.0" -pydantic = {version = ">=1.6.1,<2.0.0", extras = ["dotenv"]} -pygtrie = ">=2.3.3,<3.0.0" -uvicorn = ">=0.11.5,<0.12.0" - -[package.extras] -scheduler = ["apscheduler (>=3.6.3,<4.0.0)"] -full = ["apscheduler (>=3.6.3,<4.0.0)", "nonebot-test (>=0.1.0,<0.2.0)", "nb-cli (>=0.2.0,<0.3.0)"] -test = ["nonebot-test (>=0.1.0,<0.2.0)"] -cli = ["nb-cli (>=0.2.0,<0.3.0)"] - -[[package]] -name = "pydantic" -version = "1.7.2" -description = "Data validation and settings management using python 3.6 type hinting" -category = "main" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -python-dotenv = {version = ">=0.10.4", optional = true, markers = "extra == \"dotenv\""} - -[package.extras] -dotenv = ["python-dotenv (>=0.10.4)"] -email = ["email-validator (>=1.0.3)"] -typing_extensions = ["typing-extensions (>=3.7.2)"] - -[[package]] -name = "pygtrie" -version = "2.4.1" -description = "A pure Python trie data structure implementation." -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "python-dotenv" -version = "0.15.0" -description = "Add .env support to your django/flask apps in development and deployments" -category = "main" -optional = false -python-versions = "*" - -[package.extras] -cli = ["click (>=5.0)"] - -[[package]] -name = "rfc3986" -version = "1.4.0" -description = "Validating URI References per RFC 3986" -category = "main" -optional = false -python-versions = "*" - -[package.dependencies] -idna = {version = "*", optional = true, markers = "extra == \"idna2008\""} - -[package.extras] -idna2008 = ["idna"] - -[[package]] -name = "sniffio" -version = "1.2.0" -description = "Sniff out which async library your code is running under" -category = "main" -optional = false -python-versions = ">=3.5" - -[[package]] -name = "starlette" -version = "0.13.4" -description = "The little ASGI library that shines." -category = "main" -optional = false -python-versions = ">=3.6" - -[package.extras] -full = ["aiofiles", "graphene", "itsdangerous", "jinja2", "python-multipart", "pyyaml", "requests", "ujson"] - -[[package]] -name = "uvicorn" -version = "0.11.8" -description = "The lightning-fast ASGI server." -category = "main" -optional = false -python-versions = "*" - -[package.dependencies] -click = ">=7.0.0,<8.0.0" -h11 = ">=0.8,<0.10" -httptools = {version = ">=0.1.0,<0.2.0", markers = "sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\""} -uvloop = {version = ">=0.14.0", markers = "sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\""} -websockets = ">=8.0.0,<9.0.0" - -[package.extras] -watchgodreload = ["watchgod (>=0.6,<0.7)"] - -[[package]] -name = "uvloop" -version = "0.14.0" -description = "Fast implementation of asyncio event loop on top of libuv" -category = "main" -optional = false -python-versions = "*" - -[[package]] -name = "websockets" -version = "8.1" -description = "An implementation of the WebSocket Protocol (RFC 6455 & 7692)" -category = "main" -optional = false -python-versions = ">=3.6.1" - -[[package]] -name = "win32-setctime" -version = "1.0.3" -description = "A small Python utility to set file creation time on Windows" -category = "main" -optional = false -python-versions = ">=3.5" - -[package.extras] -dev = ["pytest (>=4.6.2)", "black (>=19.3b0)"] - -[metadata] -lock-version = "1.1" -python-versions = "^3.7" -content-hash = "27e9698a6239bc8d04cf78c6cfb4ff1295a7277bc081013e85bec67df21cbade" - -[metadata.files] -certifi = [ - {file = "certifi-2020.11.8-py2.py3-none-any.whl", hash = "sha256:1f422849db327d534e3d0c5f02a263458c3955ec0aae4ff09b95f195c59f4edd"}, - {file = "certifi-2020.11.8.tar.gz", hash = "sha256:f05def092c44fbf25834a51509ef6e631dc19765ab8a57b4e7ab85531f0a9cf4"}, -] -click = [ - {file = "click-7.1.2-py2.py3-none-any.whl", hash = "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc"}, - {file = "click-7.1.2.tar.gz", hash = "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a"}, -] -colorama = [ - {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, - {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, -] -fastapi = [ - {file = "fastapi-0.58.1-py3-none-any.whl", hash = "sha256:d7499761d5ca901cdf5b6b73018d14729593f8ab1ea22d241f82fa574fc406ad"}, - {file = "fastapi-0.58.1.tar.gz", hash = "sha256:92e59b77eef7d6eaa80b16d275adda06b5f33b12d777e3fc5521b2f7f4718e13"}, -] -h11 = [ - {file = "h11-0.9.0-py2.py3-none-any.whl", hash = "sha256:4bc6d6a1238b7615b266ada57e0618568066f57dd6fa967d1290ec9309b2f2f1"}, - {file = "h11-0.9.0.tar.gz", hash = "sha256:33d4bca7be0fa039f4e84d50ab00531047e53d6ee8ffbc83501ea602c169cae1"}, -] -httpcore = [ - {file = "httpcore-0.12.2-py3-none-any.whl", hash = "sha256:420700af11db658c782f7e8fda34f9dcd95e3ee93944dd97d78cb70247e0cd06"}, - {file = "httpcore-0.12.2.tar.gz", hash = "sha256:dd1d762d4f7c2702149d06be2597c35fb154c5eff9789a8c5823fbcf4d2978d6"}, -] -httptools = [ - {file = "httptools-0.1.1-cp35-cp35m-macosx_10_13_x86_64.whl", hash = "sha256:a2719e1d7a84bb131c4f1e0cb79705034b48de6ae486eb5297a139d6a3296dce"}, - {file = "httptools-0.1.1-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:fa3cd71e31436911a44620473e873a256851e1f53dee56669dae403ba41756a4"}, - {file = "httptools-0.1.1-cp36-cp36m-macosx_10_13_x86_64.whl", hash = "sha256:86c6acd66765a934e8730bf0e9dfaac6fdcf2a4334212bd4a0a1c78f16475ca6"}, - {file = "httptools-0.1.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:bc3114b9edbca5a1eb7ae7db698c669eb53eb8afbbebdde116c174925260849c"}, - {file = "httptools-0.1.1-cp36-cp36m-win_amd64.whl", hash = "sha256:ac0aa11e99454b6a66989aa2d44bca41d4e0f968e395a0a8f164b401fefe359a"}, - {file = "httptools-0.1.1-cp37-cp37m-macosx_10_13_x86_64.whl", hash = "sha256:96da81e1992be8ac2fd5597bf0283d832287e20cb3cfde8996d2b00356d4e17f"}, - {file = "httptools-0.1.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:56b6393c6ac7abe632f2294da53f30d279130a92e8ae39d8d14ee2e1b05ad1f2"}, - {file = "httptools-0.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:96eb359252aeed57ea5c7b3d79839aaa0382c9d3149f7d24dd7172b1bcecb009"}, - {file = "httptools-0.1.1-cp38-cp38-macosx_10_13_x86_64.whl", hash = "sha256:fea04e126014169384dee76a153d4573d90d0cbd1d12185da089f73c78390437"}, - {file = "httptools-0.1.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:3592e854424ec94bd17dc3e0c96a64e459ec4147e6d53c0a42d0ebcef9cb9c5d"}, - {file = "httptools-0.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:0a4b1b2012b28e68306575ad14ad5e9120b34fccd02a81eb08838d7e3bbb48be"}, - {file = "httptools-0.1.1.tar.gz", hash = "sha256:41b573cf33f64a8f8f3400d0a7faf48e1888582b6f6e02b82b9bd4f0bf7497ce"}, -] -httpx = [ - {file = "httpx-0.16.1-py3-none-any.whl", hash = "sha256:9cffb8ba31fac6536f2c8cde30df859013f59e4bcc5b8d43901cb3654a8e0a5b"}, - {file = "httpx-0.16.1.tar.gz", hash = "sha256:126424c279c842738805974687e0518a94c7ae8d140cd65b9c4f77ac46ffa537"}, -] -idna = [ - {file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0"}, - {file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"}, -] -loguru = [ - {file = "loguru-0.5.3-py3-none-any.whl", hash = "sha256:f8087ac396b5ee5f67c963b495d615ebbceac2796379599820e324419d53667c"}, - {file = "loguru-0.5.3.tar.gz", hash = "sha256:b28e72ac7a98be3d28ad28570299a393dfcd32e5e3f6a353dec94675767b6319"}, -] -nonebot2 = [ - {file = "nonebot2-2.0.0a6-py3-none-any.whl", hash = "sha256:a34154f434cbe1421dc28f199dddddda5b02984674035487da9548205234a6c3"}, - {file = "nonebot2-2.0.0a6.tar.gz", hash = "sha256:b1f89a311958a8363c813d96327854c8d34aeb0bc3720def8d8f32f8155ec37d"}, -] -pydantic = [ - {file = "pydantic-1.7.2-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:dfaa6ed1d509b5aef4142084206584280bb6e9014f01df931ec6febdad5b200a"}, - {file = "pydantic-1.7.2-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:2182ba2a9290964b278bcc07a8d24207de709125d520efec9ad6fa6f92ee058d"}, - {file = "pydantic-1.7.2-cp36-cp36m-manylinux2014_i686.whl", hash = "sha256:0fe8b45d31ae53d74a6aa0bf801587bd49970070eac6a6326f9fa2a302703b8a"}, - {file = "pydantic-1.7.2-cp36-cp36m-manylinux2014_x86_64.whl", hash = "sha256:01f0291f4951580f320f7ae3f2ecaf0044cdebcc9b45c5f882a7e84453362420"}, - {file = "pydantic-1.7.2-cp36-cp36m-win_amd64.whl", hash = "sha256:4ba6b903e1b7bd3eb5df0e78d7364b7e831ed8b4cd781ebc3c4f1077fbcb72a4"}, - {file = "pydantic-1.7.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b11fc9530bf0698c8014b2bdb3bbc50243e82a7fa2577c8cfba660bcc819e768"}, - {file = "pydantic-1.7.2-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:a3c274c49930dc047a75ecc865e435f3df89715c775db75ddb0186804d9b04d0"}, - {file = "pydantic-1.7.2-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:c68b5edf4da53c98bb1ccb556ae8f655575cb2e676aef066c12b08c724a3f1a1"}, - {file = "pydantic-1.7.2-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:95d4410c4e429480c736bba0db6cce5aaa311304aea685ebcf9ee47571bfd7c8"}, - {file = "pydantic-1.7.2-cp37-cp37m-win_amd64.whl", hash = "sha256:a2fc7bf77ed4a7a961d7684afe177ff59971828141e608f142e4af858e07dddc"}, - {file = "pydantic-1.7.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b9572c0db13c8658b4a4cb705dcaae6983aeb9842248b36761b3fbc9010b740f"}, - {file = "pydantic-1.7.2-cp38-cp38-manylinux1_i686.whl", hash = "sha256:f83f679e727742b0c465e7ef992d6da4a7e5268b8edd8fdaf5303276374bef52"}, - {file = "pydantic-1.7.2-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:e5fece30e80087d9b7986104e2ac150647ec1658c4789c89893b03b100ca3164"}, - {file = "pydantic-1.7.2-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:ce2d452961352ba229fe1e0b925b41c0c37128f08dddb788d0fd73fd87ea0f66"}, - {file = "pydantic-1.7.2-cp38-cp38-win_amd64.whl", hash = "sha256:fc21a37ff3f545de80b166e1735c4172b41b017948a3fb2d5e2f03c219eac50a"}, - {file = "pydantic-1.7.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c9760d1556ec59ff745f88269a8f357e2b7afc75c556b3a87b8dda5bc62da8ba"}, - {file = "pydantic-1.7.2-cp39-cp39-manylinux1_i686.whl", hash = "sha256:2c1673633ad1eea78b1c5c420a47cd48717d2ef214c8230d96ca2591e9e00958"}, - {file = "pydantic-1.7.2-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:388c0c26c574ff49bad7d0fd6ed82fbccd86a0473fa3900397d3354c533d6ebb"}, - {file = "pydantic-1.7.2-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:ab1d5e4d8de00575957e1c982b951bffaedd3204ddd24694e3baca3332e53a23"}, - {file = "pydantic-1.7.2-cp39-cp39-win_amd64.whl", hash = "sha256:f045cf7afb3352a03bc6cb993578a34560ac24c5d004fa33c76efec6ada1361a"}, - {file = "pydantic-1.7.2-py3-none-any.whl", hash = "sha256:6665f7ab7fbbf4d3c1040925ff4d42d7549a8c15fe041164adfe4fc2134d4cce"}, - {file = "pydantic-1.7.2.tar.gz", hash = "sha256:c8200aecbd1fb914e1bd061d71a4d1d79ecb553165296af0c14989b89e90d09b"}, -] -pygtrie = [ - {file = "pygtrie-2.4.1.tar.gz", hash = "sha256:4367b87d92eaf475107421dce0295a9d4d72156702908c96c430a426b654aee7"}, -] -python-dotenv = [ - {file = "python-dotenv-0.15.0.tar.gz", hash = "sha256:587825ed60b1711daea4832cf37524dfd404325b7db5e25ebe88c495c9f807a0"}, - {file = "python_dotenv-0.15.0-py2.py3-none-any.whl", hash = "sha256:0c8d1b80d1a1e91717ea7d526178e3882732420b03f08afea0406db6402e220e"}, -] -rfc3986 = [ - {file = "rfc3986-1.4.0-py2.py3-none-any.whl", hash = "sha256:af9147e9aceda37c91a05f4deb128d4b4b49d6b199775fd2d2927768abdc8f50"}, - {file = "rfc3986-1.4.0.tar.gz", hash = "sha256:112398da31a3344dc25dbf477d8df6cb34f9278a94fee2625d89e4514be8bb9d"}, -] -sniffio = [ - {file = "sniffio-1.2.0-py3-none-any.whl", hash = "sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663"}, - {file = "sniffio-1.2.0.tar.gz", hash = "sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de"}, -] -starlette = [ - {file = "starlette-0.13.4-py3-none-any.whl", hash = "sha256:0fb4b38d22945b46acb880fedee7ee143fd6c0542992501be8c45c0ed737dd1a"}, - {file = "starlette-0.13.4.tar.gz", hash = "sha256:04fe51d86fd9a594d9b71356ed322ccde5c9b448fc716ac74155e5821a922f8d"}, -] -uvicorn = [ - {file = "uvicorn-0.11.8-py3-none-any.whl", hash = "sha256:4b70ddb4c1946e39db9f3082d53e323dfd50634b95fd83625d778729ef1730ef"}, - {file = "uvicorn-0.11.8.tar.gz", hash = "sha256:46a83e371f37ea7ff29577d00015f02c942410288fb57def6440f2653fff1d26"}, -] -uvloop = [ - {file = "uvloop-0.14.0-cp35-cp35m-macosx_10_11_x86_64.whl", hash = "sha256:08b109f0213af392150e2fe6f81d33261bb5ce968a288eb698aad4f46eb711bd"}, - {file = "uvloop-0.14.0-cp35-cp35m-manylinux2010_x86_64.whl", hash = "sha256:4544dcf77d74f3a84f03dd6278174575c44c67d7165d4c42c71db3fdc3860726"}, - {file = "uvloop-0.14.0-cp36-cp36m-macosx_10_11_x86_64.whl", hash = "sha256:b4f591aa4b3fa7f32fb51e2ee9fea1b495eb75b0b3c8d0ca52514ad675ae63f7"}, - {file = "uvloop-0.14.0-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:f07909cd9fc08c52d294b1570bba92186181ca01fe3dc9ffba68955273dd7362"}, - {file = "uvloop-0.14.0-cp37-cp37m-macosx_10_11_x86_64.whl", hash = "sha256:afd5513c0ae414ec71d24f6f123614a80f3d27ca655a4fcf6cabe50994cc1891"}, - {file = "uvloop-0.14.0-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:e7514d7a48c063226b7d06617cbb12a14278d4323a065a8d46a7962686ce2e95"}, - {file = "uvloop-0.14.0-cp38-cp38-macosx_10_11_x86_64.whl", hash = "sha256:bcac356d62edd330080aed082e78d4b580ff260a677508718f88016333e2c9c5"}, - {file = "uvloop-0.14.0-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:4315d2ec3ca393dd5bc0b0089d23101276778c304d42faff5dc4579cb6caef09"}, - {file = "uvloop-0.14.0.tar.gz", hash = "sha256:123ac9c0c7dd71464f58f1b4ee0bbd81285d96cdda8bc3519281b8973e3a461e"}, -] -websockets = [ - {file = "websockets-8.1-cp36-cp36m-macosx_10_6_intel.whl", hash = "sha256:3762791ab8b38948f0c4d281c8b2ddfa99b7e510e46bd8dfa942a5fff621068c"}, - {file = "websockets-8.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:3db87421956f1b0779a7564915875ba774295cc86e81bc671631379371af1170"}, - {file = "websockets-8.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4f9f7d28ce1d8f1295717c2c25b732c2bc0645db3215cf757551c392177d7cb8"}, - {file = "websockets-8.1-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:295359a2cc78736737dd88c343cd0747546b2174b5e1adc223824bcaf3e164cb"}, - {file = "websockets-8.1-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:1d3f1bf059d04a4e0eb4985a887d49195e15ebabc42364f4eb564b1d065793f5"}, - {file = "websockets-8.1-cp36-cp36m-win32.whl", hash = "sha256:2db62a9142e88535038a6bcfea70ef9447696ea77891aebb730a333a51ed559a"}, - {file = "websockets-8.1-cp36-cp36m-win_amd64.whl", hash = "sha256:0e4fb4de42701340bd2353bb2eee45314651caa6ccee80dbd5f5d5978888fed5"}, - {file = "websockets-8.1-cp37-cp37m-macosx_10_6_intel.whl", hash = "sha256:9b248ba3dd8a03b1a10b19efe7d4f7fa41d158fdaa95e2cf65af5a7b95a4f989"}, - {file = "websockets-8.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:ce85b06a10fc65e6143518b96d3dca27b081a740bae261c2fb20375801a9d56d"}, - {file = "websockets-8.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:965889d9f0e2a75edd81a07592d0ced54daa5b0785f57dc429c378edbcffe779"}, - {file = "websockets-8.1-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:751a556205d8245ff94aeef23546a1113b1dd4f6e4d102ded66c39b99c2ce6c8"}, - {file = "websockets-8.1-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:3ef56fcc7b1ff90de46ccd5a687bbd13a3180132268c4254fc0fa44ecf4fc422"}, - {file = "websockets-8.1-cp37-cp37m-win32.whl", hash = "sha256:7ff46d441db78241f4c6c27b3868c9ae71473fe03341340d2dfdbe8d79310acc"}, - {file = "websockets-8.1-cp37-cp37m-win_amd64.whl", hash = "sha256:20891f0dddade307ffddf593c733a3fdb6b83e6f9eef85908113e628fa5a8308"}, - {file = "websockets-8.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:c1ec8db4fac31850286b7cd3b9c0e1b944204668b8eb721674916d4e28744092"}, - {file = "websockets-8.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:5c01fd846263a75bc8a2b9542606927cfad57e7282965d96b93c387622487485"}, - {file = "websockets-8.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:9bef37ee224e104a413f0780e29adb3e514a5b698aabe0d969a6ba426b8435d1"}, - {file = "websockets-8.1-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:d705f8aeecdf3262379644e4b55107a3b55860eb812b673b28d0fbc347a60c55"}, - {file = "websockets-8.1-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:c8a116feafdb1f84607cb3b14aa1418424ae71fee131642fc568d21423b51824"}, - {file = "websockets-8.1-cp38-cp38-win32.whl", hash = "sha256:e898a0863421650f0bebac8ba40840fc02258ef4714cb7e1fd76b6a6354bda36"}, - {file = "websockets-8.1-cp38-cp38-win_amd64.whl", hash = "sha256:f8a7bff6e8664afc4e6c28b983845c5bc14965030e3fb98789734d416af77c4b"}, - {file = "websockets-8.1.tar.gz", hash = "sha256:5c65d2da8c6bce0fca2528f69f44b2f977e06954c8512a952222cea50dad430f"}, -] -win32-setctime = [ - {file = "win32_setctime-1.0.3-py3-none-any.whl", hash = "sha256:dc925662de0a6eb987f0b01f599c01a8236cb8c62831c22d9cada09ad958243e"}, - {file = "win32_setctime-1.0.3.tar.gz", hash = "sha256:4e88556c32fdf47f64165a2180ba4552f8bb32c1103a2fafd05723a0bd42bd4b"}, -] From 146134a1a7e19632c8adbe2d264398c979a487e4 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sat, 28 Nov 2020 11:44:34 +0800 Subject: [PATCH 32/34] :bookmark: update nonebot-plugin-docs author --- docs/.vuepress/public/plugins.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/.vuepress/public/plugins.json b/docs/.vuepress/public/plugins.json index b5c5760b..6fa84155 100644 --- a/docs/.vuepress/public/plugins.json +++ b/docs/.vuepress/public/plugins.json @@ -29,7 +29,7 @@ "author": "nonebot", "desc": "在本地浏览NoneBot文档", "name": "NoneBot离线文档", - "repo": "yanyongyu/nonebot2/tree/master/packages/nonebot-plugin-docs" + "repo": "nonebot/nonebot2/tree/master/packages/nonebot-plugin-docs" }, { "id": "nonebot_plugin_sentry", From 62b93c1ba7480910926c925d4c671a0b5dd20b92 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sat, 28 Nov 2020 11:55:12 +0800 Subject: [PATCH 33/34] :fire: remove file header --- packages/nonebot-plugin-docs/README.md | 8 -------- .../nonebot_plugin_docs/__init__.py | 12 ------------ .../nonebot_plugin_docs/drivers/fastapi.py | 12 ------------ 3 files changed, 32 deletions(-) diff --git a/packages/nonebot-plugin-docs/README.md b/packages/nonebot-plugin-docs/README.md index 88b9fcd3..fc234c24 100644 --- a/packages/nonebot-plugin-docs/README.md +++ b/packages/nonebot-plugin-docs/README.md @@ -1,11 +1,3 @@ -

nonebot

diff --git a/packages/nonebot-plugin-docs/nonebot_plugin_docs/__init__.py b/packages/nonebot-plugin-docs/nonebot_plugin_docs/__init__.py index 848d9438..161cd626 100644 --- a/packages/nonebot-plugin-docs/nonebot_plugin_docs/__init__.py +++ b/packages/nonebot-plugin-docs/nonebot_plugin_docs/__init__.py @@ -1,15 +1,3 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -""" -@Author : yanyongyu -@Date : 2020-11-22 00:56:58 -@LastEditors : yanyongyu -@LastEditTime : 2020-11-22 01:00:29 -@Description : None -@GitHub : https://github.com/yanyongyu -""" -__author__ = "yanyongyu" - import importlib import nonebot diff --git a/packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py b/packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py index 79c2f4fe..da598d19 100644 --- a/packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py +++ b/packages/nonebot-plugin-docs/nonebot_plugin_docs/drivers/fastapi.py @@ -1,15 +1,3 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -""" -@Author : yanyongyu -@Date : 2020-11-22 00:56:31 -@LastEditors : yanyongyu -@LastEditTime : 2020-11-22 02:16:42 -@Description : None -@GitHub : https://github.com/yanyongyu -""" -__author__ = "yanyongyu" - from pathlib import Path from nonebot.drivers.fastapi import Driver From b75343d3e7145fd180f98f4d7dd7004687de72ab Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Sat, 28 Nov 2020 11:59:26 +0800 Subject: [PATCH 34/34] :memo: update homepage and repo link --- packages/nonebot-plugin-docs/README.md | 4 ++-- packages/nonebot-plugin-docs/pyproject.toml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nonebot-plugin-docs/README.md b/packages/nonebot-plugin-docs/README.md index fc234c24..df099b03 100644 --- a/packages/nonebot-plugin-docs/README.md +++ b/packages/nonebot-plugin-docs/README.md @@ -11,8 +11,8 @@ _✨ NoneBot 本地文档插件 ✨_

- - license + + license pypi diff --git a/packages/nonebot-plugin-docs/pyproject.toml b/packages/nonebot-plugin-docs/pyproject.toml index cf72757b..7f3a49bc 100644 --- a/packages/nonebot-plugin-docs/pyproject.toml +++ b/packages/nonebot-plugin-docs/pyproject.toml @@ -5,8 +5,8 @@ description = "View NoneBot2 Docs Locally" authors = ["yanyongyu "] license = "MIT" readme = "README.md" -homepage = "https://github.com/yanyongyu/nonebot2/blob/master/packages/nonebot-plugin-docs" -repository = "https://github.com/yanyongyu/nonebot2" +homepage = "https://github.com/nonebot/nonebot2/blob/master/packages/nonebot-plugin-docs" +repository = "https://github.com/nonebot/nonebot2" keywords = ["nonebot", "nonebot2", "docs"] include = ["nonebot_plugin_docs/dist/**/*"]