Skip to content

remove init requirement to figure out if the app exists#5507

Merged
adhami3310 merged 1 commit into
mainfrom
remove-init-requirement-to-figure-out-the-import-guy
Jun 26, 2025
Merged

remove init requirement to figure out if the app exists#5507
adhami3310 merged 1 commit into
mainfrom
remove-init-requirement-to-figure-out-the-import-guy

Conversation

@adhami3310
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Modified package detection logic in reflex/utils/misc.py to remove the requirement for __init__.py files, enabling support for PEP 420 namespace packages.

  • Significant change to get_module_path function that now treats any directory as a potential package without requiring __init__.py
  • Could impact module resolution behavior and how Reflex identifies valid Python packages
  • May require careful testing with existing projects that rely on traditional package structures

1 file reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

Comment thread reflex/utils/misc.py
Comment on lines +40 to 43
if potential_dir.is_dir():
# It's a package, so we can continue deeper
current_path = potential_dir
else:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

logic: traversing directories without init.py check could include non-package directories, potentially causing incorrect module resolution

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

that's the point you dumbass

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Jun 26, 2025

CodSpeed Performance Report

Merging #5507 will not alter performance

Comparing remove-init-requirement-to-figure-out-the-import-guy (215509c) with main (a9f8ab0)

Summary

✅ 8 untouched benchmarks

@adhami3310 adhami3310 merged commit 551c5c4 into main Jun 26, 2025
41 checks passed
@adhami3310 adhami3310 deleted the remove-init-requirement-to-figure-out-the-import-guy branch June 26, 2025 23:51
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.

2 participants