Skip to content

Support application layouts where the holm app is in a subpackage#45

Merged
volfpeter merged 4 commits into
mainfrom
feat/support-app-in-subpackage
Jan 3, 2026
Merged

Support application layouts where the holm app is in a subpackage#45
volfpeter merged 4 commits into
mainfrom
feat/support-app-in-subpackage

Conversation

@volfpeter
Copy link
Copy Markdown
Owner

@volfpeter volfpeter commented Jan 3, 2026

refs #41

Summary by CodeRabbit

  • Refactor

    • Simplified configuration/startup: the app directory is now inferred directly from the package location and project root detection is clearer, removing an obsolete directory-name setting to reduce ambiguity and make initialization more predictable.
  • Chores

    • Package version bumped to 0.7.4.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 3, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

AppConfig in holm/_model.py replaces app_dir_name: str with app_dir: Path, and AppConfig.default() now assigns app_dir to caller_package_path while climbing a local root_dir to compute root_dir. The package version in holm/__init__.py was bumped from 0.7.3 to 0.7.4. (38 words)

Changes

Cohort / File(s) Summary
AppConfig dataclass refactoring
holm/_model.py
Removed app_dir_name: str; added public app_dir: Path with docstring. AppConfig.default() uses a local root_dir initialized from caller_package_path, updates it via root_dir = root_dir.parent while climbing, and constructs AppConfig with app_dir set to caller_package_path. app_dir construction/assignment logic removed; app_url_prefix_length docstring updated.
Version bump
holm/__init__.py
Updated __version__ string from "0.7.3" to "0.7.4".

Sequence Diagram(s)

(omitted — changes are dataclass/initialization refactor and a version bump without multi-component sequential control flow)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Poem

I hopped through folders, leaf and sod,
Swapped a name and found the root of the pod.
AppDir sits where the package stood,
Version bumped — a small hop for good. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: supporting application layouts where holm is in a subpackage, which aligns with the modifications to AppConfig's app_dir handling and directory path logic.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3377413 and f0ebbce.

📒 Files selected for processing (1)
  • holm/__init__.py

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between da5a3f7 and 08fe148.

📒 Files selected for processing (1)
  • holm/_model.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-22T23:11:22.422Z
Learnt from: volfpeter
Repo: volfpeter/holm PR: 42
File: examples/forms/page.py:15-15
Timestamp: 2025-12-22T23:11:22.422Z
Learning: In htmy v0.10.0 and later, do not use html tag objects (e.g., html.div, html.form, html.head) as type hints or return types. Replace these with htmy's ComponentType or Component for type annotations in Python code (e.g., def render(...) -> Component or def handler(...) -> ComponentType). Apply this consistently across Python files where htmy HTML tag objects are used in type hints.

Applied to files:

  • holm/_model.py
🔇 Additional comments (3)
holm/_model.py (3)

31-32: LGTM! Type-safe improvement.

The new app_dir: Path field is a good improvement over the previous string-based approach, providing better type safety and clearer semantics.


49-54: LGTM! Clean separation of concerns.

The refactored logic correctly separates the computation of root_dir from caller_package_path, which enables the direct assignment of app_dir later. The climbing logic properly handles nested package structures.


59-60: LGTM! Clear and correct instantiation.

The direct assignment of app_dir=caller_package_path and use of the computed root_dir is straightforward and aligns well with the refactored approach.

Comment thread holm/_model.py Outdated
@volfpeter volfpeter changed the title Support application layouts where the holm app is in a subpackag Support application layouts where the holm app is in a subpackage Jan 3, 2026
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 08fe148 and e7b8bc4.

📒 Files selected for processing (1)
  • holm/_model.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-22T23:11:22.422Z
Learnt from: volfpeter
Repo: volfpeter/holm PR: 42
File: examples/forms/page.py:15-15
Timestamp: 2025-12-22T23:11:22.422Z
Learning: In htmy v0.10.0 and later, do not use html tag objects (e.g., html.div, html.form, html.head) as type hints or return types. Replace these with htmy's ComponentType or Component for type annotations in Python code (e.g., def render(...) -> Component or def handler(...) -> ComponentType). Apply this consistently across Python files where htmy HTML tag objects are used in type hints.

Applied to files:

  • holm/_model.py
🔇 Additional comments (1)
holm/_model.py (1)

48-66: LGTM! Well-structured refactoring.

The refactoring from app_dir_name: str to app_dir: Path is a solid improvement that properly supports applications in subpackages. The logic correctly:

  • Sets app_dir to the actual application directory path
  • Computes root_dir by walking up the package hierarchy
  • Maintains consistent URL prefix calculation

Comment thread holm/_model.py Outdated
@volfpeter volfpeter merged commit 1ea515c into main Jan 3, 2026
2 of 3 checks passed
@volfpeter volfpeter deleted the feat/support-app-in-subpackage branch January 3, 2026 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant