-
Notifications
You must be signed in to change notification settings - Fork 903
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
Add python support for Functions Emulator. #5423
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
a4a81d0
to
d268610
Compare
a3d53fd
to
91723d0
Compare
e7e6246
to
c81d8f2
Compare
c81247a
to
9a9c5e7
Compare
Codecov ReportBase: 56.40% // Head: 56.30% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #5423 +/- ##
==========================================
- Coverage 56.40% 56.30% -0.11%
==========================================
Files 313 315 +2
Lines 21245 21348 +103
Branches 4336 4353 +17
==========================================
+ Hits 11984 12020 +36
- Misses 8221 8287 +66
- Partials 1040 1041 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
bb6313e
to
a79cbc7
Compare
UPDATE: it's working now, npm wasn't linked to the correct repository. Hi Daniel! thanks for your work I created a new functions project with Python, installed emulators, then: [debug] [2023-01-18T13:37:27.463Z] Error: Cannot find module '/Users/mais/Invertase/firebase-functions-python2/samples/basic_https/functions/package.json' Full logs:
|
e7d25e2
to
6063984
Compare
4fbf060
to
f0379a6
Compare
cb26de7
to
f549605
Compare
Add support for loading and serving functions written using the Firebase Functions Python SDK (WIP: https://github.com/firebase/firebase-functions-python)
This PR is a fork of #4653 extended with support for emulating Python functions.
Python Runtime Delegate implementation is unsurprising but does include some additional wrapper code to make sure all commands (e.g. spinning up the admin server) runs within the virtualenv environment. For now, we hardcode virtual environment
venv
directory exists on the developer's laptop, but we'll later add support for specifying arbitrary directory for specifying virtualenv directory via firebase.json configuration.Another note is that each emulated Python function will bind to a Port instead of Unix Domain Socket (UDS) as done when emulating Node.js function. This is because there is no straightfoward, platform-neutral way to bind python webserver to UDS. Finding large number of open port might have a bit more performance penalty and cause bugs due to race condition (similar to #5418) but it seems that we have no other choice atm.