misc/ Python スクリプトの整備(改行正規化・make_bib.py 修正・timeout 追加) - #176
Open
k-yoshimi wants to merge 3 commits into
Open
Conversation
- Normalize line endings of all misc/*.py to LF (make_readme*.py were CR-only, the rest CRLF) and add .gitattributes to keep them LF - make_bib.py: use ASCII slugs as bibitem cite keys (names with spaces or non-ASCII cannot be \cite'd), resolve paths relative to the script, warn on missing HDF5 groups, drop unused code, and switch the shebang to /usr/bin/env python3 - get_info.py, get_info_ja.py: add a 30s timeout to HTTP requests and retry the list pages on transient 5xx like the detail pages - Commit mainstaller.bib regenerated with the new cite keys Fixes #170 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- get_retry (get_info.py, get_info_ja.py): the newly added timeout raised instead of being retried; now RequestException is retried with the same backoff and re-raised only after retries are exhausted (verified with mocked-requests unit tests) - make_bib.py: open the bib with encoding='utf-8' and exit nonzero when expected HDF5 groups are missing instead of silently producing an incomplete bibliography Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- misc/README.md: document each generator script's expected working directory and inputs (they are inconsistent), and the procedure to regenerate the committed mainstaller.bib - .gitattributes: also normalize *.sh to LF so Windows checkouts with autocrlf cannot introduce CRLF into POSIX sh scripts (verified no tracked .sh file currently has CRLF) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
Author
AI review cycle (Codex + Antigravity) 結果Phase 1 (Codex): must_fix 0 / should_fix 2 / optional 2 → 全て追加コミット 5dd3df2 で対応:
Phase 2 (Antigravity): must_fix_docs 0 → 追加コミットで対応:
→ 両フェーズ収束。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Fixes #170
改行の正規化
misc/*.py全 7 ファイルを LF に統一しました(make_readme*.pyとmake_bib.pyは CR のみ、残りは CRLF)。再発防止として.gitattributesに*.py text eol=lfを追加。このため既存ファイルの diff が全行書き換えに見えますが、git diff -w --ignore-cr-at-eol相当では改行以外の変更はありません(下記の個別修正を除く)。make_bib.py(新規追加 + 修正)
\bibitemの cite キーを表示名(Kω、QUANTUM ESPRESSOなど空白・非 ASCII を含み\cite不能)から ASCII スラッグ(komega,espresso等)に変更し、表示名は本文側に出力dirs_apps/dict_apps/list_read/import re等を削除、shebang を#!/usr/bin/env python3にmainstaller.bibもコミット(生成物を repo に置かない方針でしたら、この 1 ファイルは落として.gitignoreに移します)get_info.py / get_info_ja.py
requests.getにtimeout=30を追加(従来はタイムアウトなしでハングし得た)get_retry経由にし、一時的な 5xx でリトライ※ Issue #170 で「
get_retryが未使用」と書きましたが、正しくは詳細ページ側では使用済みで、未使用だったのは一覧ページ側のみでした。訂正します。検証
python3 -m py_compileを通過python3 misc/make_bib.pyを実際に実行し、コミットしたmainstaller.bibが生成されることを確認(15 エントリ、全キー ASCII)🤖 Generated with Claude Code