Skip to content

Commit 145af2a

Browse files
authored
v2.6.18: 修复 Linux 环境下全新安装时缺失 jmv 命令的问题 (#527); 增加环境变量集成校验 (#528)
1 parent 2225136 commit 145af2a

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ Documentation = "https://jmcomic.readthedocs.io"
3838

3939
[project.scripts]
4040
jmcomic = "jmcomic.cl:main"
41+
jmv = "jmcomic.cl:view_main"
4142

4243
[tool.setuptools.dynamic]
4344
version = {attr = "jmcomic.__version__"}

src/jmcomic/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# 被依赖方 <--- 使用方
33
# config <--- entity <--- toolkit <--- client <--- option <--- downloader
44

5-
__version__ = '2.6.17'
5+
__version__ = '2.6.18'
66

77
from .api import *
88
from .jm_plugin import *

tests/test_jmcomic/test_jm_cli.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,31 @@ def test_jmcomic_download_album(self):
4343

4444
# ========== jmv 命令测试 ==========
4545

46+
def test_entry_points_installed(self):
47+
"""验证控制台命令行是否被正确安装到了所在系统的环境变量里"""
48+
import shutil
49+
import subprocess
50+
for cmd in ['jmcomic', 'jmv']:
51+
self.assertIsNotNone(
52+
shutil.which(cmd),
53+
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."
54+
)
55+
56+
try:
57+
subprocess.run(
58+
[cmd, "--help"],
59+
capture_output=True,
60+
text=True,
61+
check=True,
62+
timeout=10,
63+
)
64+
except subprocess.TimeoutExpired:
65+
self.fail(f"Command '{cmd} --help' timed out execution.")
66+
except subprocess.CalledProcessError as e:
67+
self.fail(f"Command '{cmd} --help' failed with exit code {e.returncode}. Stderr: {e.stderr.strip()}")
68+
except OSError as e:
69+
self.fail(f"Failed to execute command '{cmd}': {e}")
70+
4671
# -- extract_album_id --
4772

4873
def test_jmv_extract_pure_digits(self):

0 commit comments

Comments
 (0)