v3.6.2 同步发版:晚子时不再双重换日、港澳时区归位

- 晚子时(真太阳时 23:00–24:00,约 4% 的盘)修正:换日改由 tyme4py provider 原生实现(cast 新增 sect 参数,1=子初 / 2=子正),排盘层不再自行预滚日。3.6.1 及此前会滚两次,日柱多进一天、时柱随之错干——锚点 1973-08-23 23:32 男:旧 癸巳日壬子时 → 正 壬辰日庚子时。已排过的晚子时盘建议重排核对
- --day-boundary 子正 现真正生效(走 sect=2,晚子时日柱算当天),此前只改审计文案不改实际排盘
- data/cities.json 港澳 28 个条目由 Asia/Shanghai 改为 Asia/Hong_Kong(19)、Asia/Macau(9):大陆 1986–1991 行夏令时而港澳 1979 年后无,沿用上海区会把大陆夏令时错加到港澳命主身上
- 修副本环境 `pytest tests/` 收集期中断(test_sync_tool 模块级加载外层 tools/,skipif 挡不住导入),现按设计整模块 skip
- .gitignore 新增 data/.license.json、data/.update_check.json,本机授权与更新缓存不再可能误入仓
- 测试 178 项全绿(副本内 sync 工具 4 项按设计 skip);manifest 1278 文件,ed25519 签名,公钥指纹 3089bc1cc9a453e5…
This commit is contained in:
2026-10-12 19:05:09 +08:00
parent 415cb472b1
commit b20fd5c3c9
14 changed files with 175 additions and 72 deletions
+12 -6
View File
@@ -1,7 +1,9 @@
"""外层 tools/sync_license_copy.py 的集成测试。
sync/build/sign 工具留在授权方工作区外层 tools/,不随本仓库分发;
副本或 clone 环境下 tools/ 不存在,整个模块 skip。
副本或 clone 环境下 tools/ 不存在,整个模块 skip。注意 skipif 只跳过测试
**执行**、挡不住模块导入,故下面的模块级 _load_module 也带同一存在性守卫,
否则副本里 `pytest tests/` 会在收集阶段就 FileNotFoundError 并中断全套测试。
测试用微型假母版(monkeypatch 替换模块 SRC)同步进临时授权副本,
不碰真实母版与真实副本;签名用测试私钥,UPDATE_PUBLIC_KEY_HEX 同步造假。
@@ -18,10 +20,12 @@ ROOT = Path(__file__).resolve().parents[1]
TOOLS = ROOT.parent / "tools"
SYNC_TOOL = TOOLS / "sync_license_copy.py"
_HAS_TOOLS = (SYNC_TOOL.is_file()
and (TOOLS / "build_manifest.py").is_file()
and (TOOLS / "sign_manifest.py").is_file())
pytestmark = pytest.mark.skipif(
not (SYNC_TOOL.is_file()
and (TOOLS / "build_manifest.py").is_file()
and (TOOLS / "sign_manifest.py").is_file()),
not _HAS_TOOLS,
reason="外层 tools/ 不随仓库分发,本环境无同步工具",
)
@@ -41,8 +45,10 @@ def _load_module(name: str, path: Path):
return mod
sync_tool = _load_module("sync_license_copy", SYNC_TOOL)
build_manifest = _load_module("build_manifest", TOOLS / "build_manifest.py")
# 无 tools/ 时置 None:本模块所有测试已被 skipif 跳过,不会触达这两个名字
sync_tool = _load_module("sync_license_copy", SYNC_TOOL) if _HAS_TOOLS else None
build_manifest = (_load_module("build_manifest", TOOLS / "build_manifest.py")
if _HAS_TOOLS else None)
def _make_master(src: Path, pk_hex: str) -> None: