fix: mille init adds src to package_names for Python src/ layout namespace packages#62
Merged
Merged
Conversation
…e of tracking PR62 work
…ing that src prefix is missing from package_names when using src/ layout in Python projects
…en found in external_allow because imports like from src.domain... were misclassified as External
…use of documenting src/ layout behavior and marking PR62 complete
…s because of verifying Bug1 (classify_py_import full path) and Bug2 (src/main.py skipped) are detected
…init because of src.domain.entity resolving to external and src/main.py being skipped
…because of documenting cross-layer resolution and shallow-file layer behavior
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.
概要
mille initが Python のsrc/レイアウトでpackage_namesを誤って生成するバグを修正する。src/domain/**のようなパスでは最終コンポーネントのdomainのみがpackage_namesに追加されていたが、実際にfrom src.domain...のようなインポートを使うプロジェクトではsrcもpackage_namesに含まれる必要があった。変更内容
src/usecase/init.rs:py_pkg_names計算ロジックに名前空間パッケージの昇格処理を追加external_allowに含まれており、かつレイヤーパスのコンポーネントでもある名前をpackage_namesへ昇格するexternal_allowから自動除去されるREADME.md: Pythonsrc/layout (namespace packages) の動作説明を追加docs/TODO.md: PR fix: mille init adds src to package_names for Python src/ layout namespace packages #62 完了項目を追加Before / After
Before:
After:
テスト
TDD (RED → GREEN → REFACTOR) サイクルで実施。追加テストケース:
test_generate_toml_namespace_src_layout_adds_src_to_package_names:src/domain/**パスでexternal_allowにsrcがあるとき、srcがpackage_namesに昇格されexternal_allowから除去されるtest_generate_toml_flat_layout_unchanged: フラットレイアウト (domain/**) では既存の動作が変わらないtest_generate_toml_namespace_only_path_component_promoted:external_allowのうちパスコンポーネントであるもの (src) のみ昇格し、そうでないもの (kaggle) はexternal_allowに残るチェックリスト