From fbbcb48e8cc367589e30d374598db80f659161fa Mon Sep 17 00:00:00 2001 From: uy_sun Date: Wed, 4 Dec 2024 22:40:36 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/noneflow.yml | 1 - pyproject.toml | 1 - .../process/test_config_pull_request.py | 10 --- .../publish/process/test_publish_check.py | 50 ------------ .../remove/process/test_remove_check.py | 30 -------- .../process/test_remove_pull_request.py | 10 --- uv.lock | 77 ------------------- 7 files changed, 179 deletions(-) diff --git a/examples/noneflow.yml b/examples/noneflow.yml index ac6b31fe..c34232a3 100644 --- a/examples/noneflow.yml +++ b/examples/noneflow.yml @@ -63,4 +63,3 @@ jobs: env: APP_ID: ${{ secrets.APP_ID }} PRIVATE_KEY: ${{ secrets.APP_KEY }} - PRE_COMMIT_HOME: /github/workspace/.cache/.pre-commit diff --git a/pyproject.toml b/pyproject.toml index cbab64fb..6b793909 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,6 @@ dependencies = [ "jinja2>=3.1.4", "nonebot-adapter-github>=0.4.1", "nonebot2>=2.4.0", - "pre-commit>=4.0.1", "pydantic-extra-types>=2.10.0", "pyjson5>=1.6.7", "tzdata>=2024.2", diff --git a/tests/github/config/process/test_config_pull_request.py b/tests/github/config/process/test_config_pull_request.py index ace3b837..79fee8bf 100644 --- a/tests/github/config/process/test_config_pull_request.py +++ b/tests/github/config/process/test_config_pull_request.py @@ -93,11 +93,6 @@ async def test_config_process_pull_request( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "push", "origin", "--delete", "publish/issue76"], check=True, @@ -171,11 +166,6 @@ async def test_process_config_pull_request_not_merged( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "push", "origin", "--delete", "publish/issue76"], check=True, diff --git a/tests/github/publish/process/test_publish_check.py b/tests/github/publish/process/test_publish_check.py index 2c179e31..69f27e04 100644 --- a/tests/github/publish/process/test_publish_check.py +++ b/tests/github/publish/process/test_publish_check.py @@ -146,11 +146,6 @@ async def test_bot_process_publish_check( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "switch", "-C", "publish/issue80"], check=True, @@ -348,11 +343,6 @@ async def test_adapter_process_publish_check( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "switch", "-C", "publish/issue80"], check=True, @@ -640,11 +630,6 @@ async def test_plugin_process_publish_check( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "switch", "-C", "publish/issue80"], check=True, @@ -937,11 +922,6 @@ async def test_plugin_process_publish_check_re_run( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "switch", "-C", "publish/issue80"], check=True, @@ -1161,11 +1141,6 @@ async def test_edit_title( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "switch", "-C", "publish/issue80"], check=True, @@ -1471,11 +1446,6 @@ async def test_process_publish_check_not_pass( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), ] # type: ignore ) @@ -1546,11 +1516,6 @@ async def test_issue_state_closed( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), ] # type: ignore ) @@ -1845,11 +1810,6 @@ async def test_skip_plugin_check( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), ] # type: ignore ) @@ -1984,11 +1944,6 @@ async def test_convert_pull_request_to_draft( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), ] # type: ignore ) @@ -2148,11 +2103,6 @@ async def test_process_publish_check_ready_for_review( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "switch", "-C", "publish/issue80"], check=True, diff --git a/tests/github/remove/process/test_remove_check.py b/tests/github/remove/process/test_remove_check.py index ee6a0611..9b780495 100644 --- a/tests/github/remove/process/test_remove_check.py +++ b/tests/github/remove/process/test_remove_check.py @@ -174,11 +174,6 @@ async def test_process_remove_bot_check( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "switch", "-C", "remove/issue80"], check=True, @@ -377,11 +372,6 @@ async def test_process_remove_plugin_check( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "switch", "-C", "remove/issue80"], check=True, @@ -524,11 +514,6 @@ async def test_process_remove_not_found_check( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), ] # type: ignore ) @@ -645,11 +630,6 @@ async def test_process_remove_author_info_not_eq( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), ] # type: ignore ) @@ -764,11 +744,6 @@ async def test_process_remove_issue_info_not_found( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), ] # type: ignore ) @@ -864,11 +839,6 @@ async def test_process_remove_driver( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), ] # type: ignore ) diff --git a/tests/github/remove/process/test_remove_pull_request.py b/tests/github/remove/process/test_remove_pull_request.py index 41057e86..7d03712d 100644 --- a/tests/github/remove/process/test_remove_pull_request.py +++ b/tests/github/remove/process/test_remove_pull_request.py @@ -96,11 +96,6 @@ async def test_remove_process_pull_request( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "push", "origin", "--delete", "publish/issue76"], check=True, @@ -177,11 +172,6 @@ async def test_process_remove_pull_request_not_merged( check=True, capture_output=True, ), - mocker.call( - ["pre-commit", "install", "--install-hooks"], - check=True, - capture_output=True, - ), mocker.call( ["git", "push", "origin", "--delete", "publish/issue76"], check=True, diff --git a/uv.lock b/uv.lock index f9f71bb2..64cc1d88 100644 --- a/uv.lock +++ b/uv.lock @@ -152,15 +152,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/7c/fc/6a8cb64e5f0324877d503c854da15d76c1e50eb722e320b15345c4d0c6de/cffi-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a", size = 182009 }, ] -[[package]] -name = "cfgv" -version = "3.4.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/11/74/539e56497d9bd1d484fd863dd69cbbfa653cd2aa27abfe35653494d85e94/cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560", size = 7114 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c5/55/51844dd50c4fc7a33b653bfaba4c2456f06955289ca770a5dbd5fd267374/cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9", size = 7249 }, -] - [[package]] name = "charset-normalizer" version = "3.4.0" @@ -288,15 +279,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/87/5c/3dab83cc4aba1f4b0e733e3f0c3e7d4386440d660ba5b1e3ff995feb734d/cryptography-43.0.3-cp39-abi3-win_amd64.whl", hash = "sha256:0c580952eef9bf68c4747774cde7ec1d85a6e61de97281f2dba83c7d2c806362", size = 3068026 }, ] -[[package]] -name = "distlib" -version = "0.3.9" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/0d/dd/1bec4c5ddb504ca60fc29472f3d27e8d4da1257a854e1d96742f15c1d02d/distlib-0.3.9.tar.gz", hash = "sha256:a60f20dea646b8a33f3e7772f74dc0b2d0772d2837ee1342a00645c81edf9403", size = 613923 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/91/a1/cf2472db20f7ce4a6be1253a81cfdf85ad9c7885ffbed7047fb72c24cf87/distlib-0.3.9-py2.py3-none-any.whl", hash = "sha256:47f8c22fd27c27e25a65601af709b38e4f0a45ea4fc2e710f65755fa8caaaf87", size = 468973 }, -] - [[package]] name = "docker" version = "7.1.0" @@ -338,15 +320,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b5/fd/afcd0496feca3276f509df3dbd5dae726fcc756f1a08d9e25abe1733f962/executing-2.1.0-py2.py3-none-any.whl", hash = "sha256:8d63781349375b5ebccc3142f4b30350c0cd9c79f921cde38be2be4637e98eaf", size = 25805 }, ] -[[package]] -name = "filelock" -version = "3.16.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/9d/db/3ef5bb276dae18d6ec2124224403d1d67bccdbefc17af4cc8f553e341ab1/filelock-3.16.1.tar.gz", hash = "sha256:c249fbfcd5db47e5e2d6d62198e565475ee65e4831e2561c8e313fa7eb961435", size = 18037 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/b9/f8/feced7779d755758a52d1f6635d990b8d98dc0a29fa568bbe0625f18fdf3/filelock-3.16.1-py3-none-any.whl", hash = "sha256:2082e5703d51fbf98ea75855d9d5527e33d8ff23099bec374a134febee6946b0", size = 16163 }, -] - [[package]] name = "githubkit" version = "0.11.14" @@ -418,15 +391,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/56/95/9377bcb415797e44274b51d46e3249eba641711cf3348050f76ee7b15ffc/httpx-0.27.2-py3-none-any.whl", hash = "sha256:7bb2708e112d8fdd7829cd4243970f0c223274051cb35ee80c03301ee29a3df0", size = 76395 }, ] -[[package]] -name = "identify" -version = "2.6.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/29/bb/25024dbcc93516c492b75919e76f389bac754a3e4248682fba32b250c880/identify-2.6.1.tar.gz", hash = "sha256:91478c5fb7c3aac5ff7bf9b4344f803843dc586832d5f110d672b19aa1984c98", size = 99097 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/7d/0c/4ef72754c050979fdcc06c744715ae70ea37e734816bb6514f79df77a42f/identify-2.6.1-py2.py3-none-any.whl", hash = "sha256:53863bcac7caf8d2ed85bd20312ea5dcfc22226800f6d6881f232d861db5a8f0", size = 98972 }, -] - [[package]] name = "idna" version = "3.10" @@ -594,15 +558,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/2a/e2/5d3f6ada4297caebe1a2add3b126fe800c96f56dbe5d1988a2cbe0b267aa/mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", size = 4695 }, ] -[[package]] -name = "nodeenv" -version = "1.9.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/43/16/fc88b08840de0e0a72a2f9d8c6bae36be573e475a6326ae854bcc549fc45/nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f", size = 47437 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d2/1d/1b658dbd2b9fa9c4c9f32accbfc0205d532c8c6194dc0f2a4c0428e7128a/nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9", size = 22314 }, -] - [[package]] name = "nonebot-adapter-github" version = "0.4.1" @@ -663,7 +618,6 @@ dependencies = [ { name = "jinja2" }, { name = "nonebot-adapter-github" }, { name = "nonebot2" }, - { name = "pre-commit" }, { name = "pydantic-extra-types" }, { name = "pyjson5" }, { name = "tzdata" }, @@ -690,7 +644,6 @@ requires-dist = [ { name = "jinja2", specifier = ">=3.1.4" }, { name = "nonebot-adapter-github", specifier = ">=0.4.1" }, { name = "nonebot2", specifier = ">=2.4.0" }, - { name = "pre-commit", specifier = ">=4.0.1" }, { name = "pydantic-extra-types", specifier = ">=2.10.0" }, { name = "pyjson5", specifier = ">=1.6.7" }, { name = "tzdata", specifier = ">=2024.2" }, @@ -767,22 +720,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/c8/e7/05282936a052138cf9e122f5c67d24d39f69606b90d8f457fcfe6a5c4e01/poethepoet-0.31.0-py3-none-any.whl", hash = "sha256:5067c5adf9f228b8af1f3df7d57dc319ed8b3f153bf21faf99f7b74494174c3d", size = 80517 }, ] -[[package]] -name = "pre-commit" -version = "4.0.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cfgv" }, - { name = "identify" }, - { name = "nodeenv" }, - { name = "pyyaml" }, - { name = "virtualenv" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/2e/c8/e22c292035f1bac8b9f5237a2622305bc0304e776080b246f3df57c4ff9f/pre_commit-4.0.1.tar.gz", hash = "sha256:80905ac375958c0444c65e9cebebd948b3cdb518f335a091a670a89d652139d2", size = 191678 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/16/8f/496e10d51edd6671ebe0432e33ff800aa86775d2d147ce7d43389324a525/pre_commit-4.0.1-py2.py3-none-any.whl", hash = "sha256:efde913840816312445dc98787724647c65473daefe420785f885e8ed9a06878", size = 218713 }, -] - [[package]] name = "prompt-toolkit" version = "3.0.36" @@ -1227,20 +1164,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ce/d9/5f4c13cecde62396b0d3fe530a50ccea91e7dfc1ccf0e09c228841bb5ba8/urllib3-2.2.3-py3-none-any.whl", hash = "sha256:ca899ca043dcb1bafa3e262d73aa25c465bfb49e0bd9dd5d59f1d0acba2f8fac", size = 126338 }, ] -[[package]] -name = "virtualenv" -version = "20.27.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "distlib" }, - { name = "filelock" }, - { name = "platformdirs" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/10/7f/192dd6ab6d91ebea7adf6c030eaf549b1ec0badda9f67a77b633602f66ac/virtualenv-20.27.0.tar.gz", hash = "sha256:2ca56a68ed615b8fe4326d11a0dca5dfbe8fd68510fb6c6349163bed3c15f2b2", size = 6483858 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c8/15/828ec11907aee2349a9342fa71fba4ba7f3af938162a382dd7da339dea16/virtualenv-20.27.0-py3-none-any.whl", hash = "sha256:44a72c29cceb0ee08f300b314848c86e57bf8d1f13107a5e671fb9274138d655", size = 3110969 }, -] - [[package]] name = "wcmatch" version = "10.0"