-
Notifications
You must be signed in to change notification settings - Fork 118
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: Support relative imports for submodules #169
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Supporting relative imports in functions framework is pointless if the live Cloud Functions environment doesn't support it as well. |
Hi @jterblanche, I'm not sure what you mean, what do you think is missing here? |
Nothing wrong here per se - but (unless I'm missing something) with target functions being invoked by Uvicorn on the Cloud Functions live platform in my opinion negates the need for this as relative imports can't be used there anyway. |
@jterblanche The HTTP server being used (gunicorn vs flask's HTTP server) should have no effect on this feature. To be extra clear here, since it seems like this is the source of the confusion: the Functions Framework (this repo) is used both for local development and is what is used to serve live Cloud Functions. Once this change is merged, released, and the Cloud Functions environment updated to include the new version of the framework, you'll be able to do relative imports in the Cloud Functions environment as well. |
Also, @grant @matthewrobertson @KaylaNguyen FYI, I'm not a maintainer of this repo anymore, you'll need to merge/release this and my other PRs. |
This is the bit I was missing thanks. |
This PR adds support for importing from submodules relative to the directory where the function is defined.