chore: rename internal package to leaf_contour_efd with compatibility shims#19
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20c199a473
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| if __name__ == "__main__": | ||
| main() | ||
| def main() -> None: |
There was a problem hiding this comment.
Restore module execution for legacy main entrypoint
Running python -m leaf_shape_tool.main now imports this module but never starts the app, because main() is defined here and no longer invoked under __main__. Before this rename, that invocation path executed the GUI, so this breaks a valid legacy entrypoint despite the stated compatibility shim behavior.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Summary
- Restored legacy module execution behavior by adding a
__main__guard tosrc/leaf_shape_tool/main.py, sopython -m leaf_shape_tool.mainnow invokesmain()again (while still delegating to the renamed implementation). src/leaf_shape_tool/main.pyL13-L23 - Kept the compatibility/deprecation behavior unchanged inside
main(), including the warning and forward call toleaf_contour_efd.mainfor phased migration support. src/leaf_shape_tool/main.pyL13-L19
Testing
- ✅
python3 -m compileall src/leaf_shape_tool/main.py - ✅
git status --short - ✅
nl -ba src/leaf_shape_tool/main.py | sed -n '1,120p'
Also completed follow-up PR actions:
- Committed fix:
fix: execute legacy leaf_shape_tool.main module entrypoint(commit8de53ff). - Created a new PR via
make_prtitled: fix: restorepython -m leaf_shape_tool.maincompatibility behavior.
Motivation
This is a phased rename to align the internal package name
leaf_shape_tool, which still remained in the codebase, with the external project nameleaf_contour_efd.The migration needed to preserve backward compatibility so that existing users would not be affected.
References in the CLI, build configuration, and documentation were also updated incrementally to the new name in order to ensure naming consistency across the project.
Description
The main implementation was moved from
src/leaf_shape_tool/tosrc/leaf_contour_efd/, and internal imports were updated toleaf_contour_efd.*.The CLI entry point was changed to
leaf_contour_efd.main:main, andproject.scriptsinpyproject.tomlwas updated accordingly.The PyInstaller entry reference in
build.specwas updated tosrc/leaf_contour_efd/__main__.py.To maintain compatibility, thin wrapper modules (
__init__.py,main.py, and__main__.py) were added undersrc/leaf_shape_tool/, so that legacy invocations are delegated to the new implementation while emitting aDeprecationWarning.In the documentation (
website/installation.qmd,website/installation_ja.qmd), examples usingpython -mwere updated topython -m leaf_contour_efd.Testing
python3 -m compileall src/leaf_contour_efd src/leaf_shape_toolwas run to confirm that the code under both packages compiles successfully (passed).Residual references before and after the rename were checked using
rg, confirming that no references toleaf_shape_toolremain except for the intentionally retained compatibility wrappers (passed).It was also verified through static inspection that the entry paths in the PyInstaller spec and
pyproject.tomlhad been updated to the new location.(Japanese)
Motivation
leaf_shape_toolをプロジェクト外向き名称に合わせてleaf_contour_efdに統一するための段階的リネームです。Description
src/leaf_shape_tool/からsrc/leaf_contour_efd/へ移動し、内部インポートをleaf_contour_efd.*に更新しました。leaf_contour_efd.main:mainに切り替え、pyproject.tomlのproject.scriptsを更新しました。build.spec内でsrc/leaf_contour_efd/__main__.pyに更新しました。src/leaf_shape_tool/に薄いラッパー (__init__.py,main.py,__main__.py) を追加し、旧呼び出しは新実装へ委譲してDeprecationWarningを発するようにしました。website/installation.qmd,website/installation_ja.qmd)内のpython -m起動例をpython -m leaf_contour_efdへ更新しました。Testing
python3 -m compileall src/leaf_contour_efd src/leaf_shape_toolを実行して両パッケージ配下のコードがコンパイル可能であることを確認しました(成功)。rgによる検索で確認し、意図的に残した互換ラッパー以外にleaf_shape_toolの参照が残っていないことを確認しました(成功)。pyproject.tomlのエントリが新パスへ更新されていることを検証しました(静的確認)。Codex Task