Repository navigation
fix(packaging): 배포 파일을 모두 256 KiB 아래로 (hwpx-plugins #66) - #676
Conversation
The Claude plugin carries the released wheel unpacked, and its directory reads at most 256 KiB of one file. form_fit/_glyph_table.py (454 KiB) and layout/pages.py (325 KiB) passed that, so the plugin's engine has been stuck at 6.8.0 since 2026-10-23. - The glyph tables ship as form_fit/_glyph_table.json.gz (gzip-compressed JSON, 65 KiB), read when hwpx.form_fit._glyph_table is imported. The readable source moves, unchanged, to scripts/glyph_table_source.py (not shipped); scripts/build_glyph_table.py writes the data file from it and tests/test_glyph_table_data.py compares every table value for value. - The lower half of layout/pages.py (constants, the paragraph and table model, the rows of a flowing table) moves, text unchanged, to layout/_page_measure.py. pages.py imports every name it defines and keeps its own imports, so hwpx.layout.pages.<name> resolves as before. - tests/test_distribution_file_sizes.py fails when a file of src/hwpx or of the built wheel reaches 256 KiB and warns past 80% of it. The wheel goes from 206 to 208 files. Advances, widths, line breaks and the page estimates of the 1,214 tracked HWPX files are the same as before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
airmang
left a comment
There was a problem hiding this comment.
Reviewed b93645f against main 168fe98, including loader/build code, packaging metadata, ownership and compatibility exports. Independently compared ASTs: all original pages.py function/class definitions are unchanged across the two modules, and the readable glyph source is identical to the previous table module. Exact-head Python 3.12 CI log records 7,707 passed, 18 skipped, 1 xfailed; all 13 PR checks pass. Local focused data/export/size checks: 17 passed, 1 skipped (wheel build tooling in that environment). Separate isolated wheel build/inspection is being completed before the merge gate. No unresolved correctness issue found. This is a COMMENT because the signed-in account owns this PR; no package or plugin release is authorized or performed.
요약
배포되는 파일이 모두 256 KiB 아래가 되게 합니다. Claude 플러그인이 엔진 배포판을 묶음에 실을 때 파일당 256 KiB 한도가 있는데,
form_fit/_glyph_table.py(464 KB)와layout/pages.py(333 KB)가 이를 넘어 2026-10-23부터 플러그인의 엔진 갱신이 멈춰 있습니다(hwpx-plugins #66)._glyph_table.json.gz(66 KB)이고,_glyph_table.py는 가져올 때 한 번 읽는 로더(3.7 KB)가 됩니다. 이름 8개와 import 경로는 그대로입니다. 사람이 고치는 원본은scripts/glyph_table_source.py이고scripts/build_glyph_table.py가 자료 파일을 만듭니다(--check지원).pages.py를 둘로 나눴습니다. 상수,_Measure, 문단·표 모델, 흐르는 표의 행 계산(정의 128개)을layout/_page_measure.py로 글자 그대로 옮겼습니다.hwpx.layout.pages.<이름>은 모두 전과 같이 풀립니다.src/hwpx와 빌드한 wheel의 모든 파일이 256 KiB에 닿으면 실패하고 80%를 넘으면 경고합니다.form_fit/_glyph_table.pyform_fit/_glyph_table.json.gzlayout/pages.pylayout/_page_measure.pywheel 파일 수는 206개에서 208개가 됩니다.
출력이 달라지지 않았다는 확인
고치기 전 main에서 뜬 값과 비교해 전부 같았습니다.
estimate_text_width·hancom_line_starts·estimate_lines2,520행estimate_pageswrite_line_caches결과병합 전에 정할 것
.py에 나누는 안입니다. 이 PR은 그와 다릅니다. 읽을 수 있는 코드로 두면 파일이 2개 이상 더 필요하고, 묶음 파일 수 한도(512개, 지금 499개)에 더 빨리 닿습니다. #66의 문구와 플러그인의 현재 검사로는 자료 파일에 문제가 없습니다.scripts/glyph_table_source.py를 고치고python scripts/build_glyph_table.py를 돌려 둘을 함께 커밋합니다.form_fit/measure.py가 한도의 75%입니다. 이번에는 나누지 않았습니다.__module__이hwpx.layout._page_measure가 됩니다.관련 이슈
Refs airmang/hwpx-plugins#66. #650과 같은 목적의 다른 방법입니다.
변경 종류
체크리스트
pytest테스트가 통과합니다. — Windows 11에서 7,693 통과, 14 실패. 실패 14건은 이 변경 전 main에서도 같은 이름으로 실패하던 것입니다(cp949, 심볼릭 링크 권한, CRLF). Linux CI 결과는 이 PR의 체크로 확인해 주세요.CHANGELOG.md를 갱신했습니다(해당하는 경우).🤖 Generated with Claude Code