Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: subpackage changes not autoreloaded #293

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions solara/server/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ def __init__(self, name, default_app_name="Page"):

self._first_execute_app = app
reload.reloader.root_path = self.directory
if self.type == AppType.MODULE:
package_name = self.name.split(".")[0]
mod = importlib.import_module(package_name)
package_root_path = Path(mod.__file__).parent
reload.reloader.root_path = package_root_path
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to be conditional (looking at the mypy error) when mod.file is None, we just skip this I think.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Made the change. Shouldn't worry too much about the ~30 errors from Python 3.9?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, but it is a seperate issue, we don't need to fix it in this PR.

app_context.close()

def _execute(self):
Expand Down