Skip to content

chore: rename internal package to leaf_contour_efd with compatibility shims#19

Merged
maple60 merged 2 commits into
chore/rename-dir-namefrom
codex/rename-internal-package-to-leaf_contour_efd
Apr 2, 2026
Merged

chore: rename internal package to leaf_contour_efd with compatibility shims#19
maple60 merged 2 commits into
chore/rename-dir-namefrom
codex/rename-internal-package-to-leaf_contour_efd

Conversation

@maple60

@maple60 maple60 commented Apr 1, 2026

Copy link
Copy Markdown
Owner

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 name leaf_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/ to src/leaf_contour_efd/, and internal imports were updated to leaf_contour_efd.*.
The CLI entry point was changed to leaf_contour_efd.main:main, and project.scripts in pyproject.toml was updated accordingly.
The PyInstaller entry reference in build.spec was updated to src/leaf_contour_efd/__main__.py.
To maintain compatibility, thin wrapper modules (__init__.py, main.py, and __main__.py) were added under src/leaf_shape_tool/, so that legacy invocations are delegated to the new implementation while emitting a DeprecationWarning.
In the documentation (website/installation.qmd, website/installation_ja.qmd), examples using python -m were updated to python -m leaf_contour_efd.

Testing

python3 -m compileall src/leaf_contour_efd src/leaf_shape_tool was 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 to leaf_shape_tool remain 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.toml had been updated to the new location.

(Japanese)

Motivation

  • 内部パッケージ名に残っていた leaf_shape_tool をプロジェクト外向き名称に合わせて leaf_contour_efd に統一するための段階的リネームです。
  • 既存ユーザーの利用に影響を与えないように後方互換性を維持しつつ移行を進める必要がありました。
  • CLI / ビルド /ドキュメントの参照も新名称へ順次切り替えることで命名の一貫性を確保します。

Description

  • 実装本体を src/leaf_shape_tool/ から src/leaf_contour_efd/ へ移動し、内部インポートを leaf_contour_efd.* に更新しました。
  • CLI エントリポイントを leaf_contour_efd.main:main に切り替え、pyproject.tomlproject.scripts を更新しました。
  • PyInstaller のエントリ参照を 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 の参照が残っていないことを確認しました(成功)。
  • PyInstaller spec と pyproject.toml のエントリが新パスへ更新されていることを検証しました(静的確認)。

Codex Task

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@codex thank you. please fix.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

  • Restored legacy module execution behavior by adding a __main__ guard to src/leaf_shape_tool/main.py, so python -m leaf_shape_tool.main now invokes main() 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 to leaf_contour_efd.main for 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 (commit 8de53ff).
  • Created a new PR via make_pr titled: fix: restore python -m leaf_shape_tool.main compatibility behavior.

View task →

@maple60 maple60 merged commit fa8bee6 into chore/rename-dir-name Apr 2, 2026
5 checks passed
@maple60 maple60 deleted the codex/rename-internal-package-to-leaf_contour_efd branch April 2, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant