chore: 移除误提交的 Python 字节码并新增 .gitignore / drop committed bytecode, add .gitignore (#122)

## 问题 / Problem


`scripts/catalog/__pycache__/validate_catalog_metadata.cpython-314.pyc`(60KB)在
#118 被误提交进仓库。

它是跑仓库校验脚本时的就地产物,**会随 `defaults/market.zip` 分发给每一个客户端**,而且只对生成它的那个 Python
版本(3.14)有效——换个版本就是纯粹的死重量。

本仓库此前**没有 `.gitignore`**,所以这类产物每次都得靠人眼发现。

A Python bytecode artifact was accidentally committed in #118. It ships
to every client inside `defaults/market.zip` and is only valid for the
exact Python version that produced it. The repository had no
`.gitignore` at all, so nothing prevented it.

## 改动 / Changes

- 删除该 `.pyc`
- 新增 `.gitignore`:`__pycache__/`、`*.py[cod]`、`.DS_Store`

## 与主仓库那道闸门的关系 / Relation to the upstream guard

desirecore/desirecore#2602 已让 `sync-market`
在同步目录不干净时拒绝打包——今天正是它拦下了我本机跑校验产生的 `cpython-310.pyc`:

```
Error: [sync-market] 同步目录存在未提交内容,拒绝打包:
    ?? scripts/catalog/__pycache__/validate_catalog_metadata.cpython-310.pyc
```

但那道断言只看**未提交内容**,拦不住已经进了仓库的 `cpython-314.pyc`。两处配合才完整:`.gitignore`
防止它被提交,洁净断言防止未提交残留被打包。

## 验证 / Verification

- `validate_catalog_metadata.py --require-complete`:0 error,75 sidecars
- `validate-i18n.py`:0 error
- 新增 `.gitignore` 后重跑校验,新产生的字节码不再出现在 `git status` 中

Co-authored-by: yi-ge <jackyoncode@gmail.com>
This commit is contained in:
2026-09-05 03:34:34 -04:00
committed by GitHub
parent 6963018829
commit 607045e44e
2 changed files with 7 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@@ -0,0 +1,7 @@
# Python 字节码:跑 scripts/catalog、scripts/i18n 下的校验脚本会就地产生。
# 它随 defaults/market.zip 分发给每个客户端,且只对生成它的那个 Python 版本有效。
__pycache__/
*.py[cod]
# macOS
.DS_Store