From 33656e92442f4850eb3d836e1a402c9a502b7bfa Mon Sep 17 00:00:00 2001 From: hect0x7 <93357912+hect0x7@users.noreply.github.com> Date: Tue, 7 Apr 2026 22:45:40 +0900 Subject: [PATCH 1/3] test: add entry points validation --- tests/test_jmcomic/test_jm_cli.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_jmcomic/test_jm_cli.py b/tests/test_jmcomic/test_jm_cli.py index 8c2a6b7a1..3c371ba6c 100644 --- a/tests/test_jmcomic/test_jm_cli.py +++ b/tests/test_jmcomic/test_jm_cli.py @@ -43,6 +43,23 @@ def test_jmcomic_download_album(self): # ========== jmv 命令测试 ========== + def test_entry_points_installed(self): + """验证控制台命令行是否被正确安装到了所在系统的环境变量里""" + import shutil + import subprocess + for cmd in ['jmcomic', 'jmv']: + self.assertIsNotNone( + shutil.which(cmd), + f"Command '{cmd}' not found in PATH. Please verify entry_points in setup.py or [project.scripts] in pyproject.toml and ensure the package is installed." + ) + + try: + subprocess.run([cmd, "--help"], capture_output=True, text=True, check=True) + except subprocess.CalledProcessError as e: + self.fail(f"Command '{cmd} --help' failed with exit code {e.returncode}. Stderr: {e.stderr.strip()}") + except Exception as e: + self.fail(f"Failed to execute command '{cmd}': {e}") + # -- extract_album_id -- def test_jmv_extract_pure_digits(self): From 5f2b5f1d6e92c2f2a93bff5df5df6842b5e3d44f Mon Sep 17 00:00:00 2001 From: hect0x7 <93357912+hect0x7@users.noreply.github.com> Date: Tue, 7 Apr 2026 22:50:17 +0900 Subject: [PATCH 2/3] fix: resolve missing jmv entry point in linux (fixes #527) and bump version to 2.6.18 --- pyproject.toml | 1 + src/jmcomic/__init__.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 966711047..e73874986 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,6 +38,7 @@ Documentation = "https://jmcomic.readthedocs.io" [project.scripts] jmcomic = "jmcomic.cl:main" +jmv = "jmcomic.cl:view_main" [tool.setuptools.dynamic] version = {attr = "jmcomic.__version__"} \ No newline at end of file diff --git a/src/jmcomic/__init__.py b/src/jmcomic/__init__.py index a052b0943..9698ba5fc 100644 --- a/src/jmcomic/__init__.py +++ b/src/jmcomic/__init__.py @@ -2,7 +2,7 @@ # 被依赖方 <--- 使用方 # config <--- entity <--- toolkit <--- client <--- option <--- downloader -__version__ = '2.6.17' +__version__ = '2.6.18' from .api import * from .jm_plugin import * From 9e4d74c800680b36099f69821b77af874b8d5904 Mon Sep 17 00:00:00 2001 From: hect0x7 <93357912+hect0x7@users.noreply.github.com> Date: Tue, 7 Apr 2026 23:08:09 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3=20PR#528=20?= =?UTF-8?q?=E7=9A=84=20review=20=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复内容: 1. [稳定性提升] 为 CLI 终端探测的 subprocess 添加 timeout=10,防止测试机环境阻塞引发挂起 2. [问题捕获精度] 将底层极为宽泛的 Exception 拦截更改为 OSError,并独立捕获 TimeoutExpired --- tests/test_jmcomic/test_jm_cli.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/test_jmcomic/test_jm_cli.py b/tests/test_jmcomic/test_jm_cli.py index 3c371ba6c..3db1b2370 100644 --- a/tests/test_jmcomic/test_jm_cli.py +++ b/tests/test_jmcomic/test_jm_cli.py @@ -54,10 +54,18 @@ def test_entry_points_installed(self): ) try: - subprocess.run([cmd, "--help"], capture_output=True, text=True, check=True) + subprocess.run( + [cmd, "--help"], + capture_output=True, + text=True, + check=True, + timeout=10, + ) + except subprocess.TimeoutExpired: + self.fail(f"Command '{cmd} --help' timed out execution.") except subprocess.CalledProcessError as e: self.fail(f"Command '{cmd} --help' failed with exit code {e.returncode}. Stderr: {e.stderr.strip()}") - except Exception as e: + except OSError as e: self.fail(f"Failed to execute command '{cmd}': {e}") # -- extract_album_id --