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
WorkerdAPI: Factor out Python module setup from compileModules #2043
base: main
Are you sure you want to change the base?
Conversation
We've added ~100 lines of Python-only logic to compileModules which is otherwise only ~30 lines long. I moved it into a separate function.
void | ||
setupPythonModules( |
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.
void | |
setupPythonModules( | |
void setupPythonModules( |
config::Worker::Reader conf, | ||
const PythonConfig& pythonConfig, | ||
CompatibilityFlags::Reader featureFlags | ||
) { |
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.
Nit: This also doesn't match kj code style
) { | ||
using namespace workerd::api::pyodide; | ||
auto confModules = conf.getModules(); | ||
auto modules = jsg::ModuleRegistryImpl<JsgWorkerdIsolate_TypeWrapper>::from(lockParam); |
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.
auto modules = jsg::ModuleRegistryImpl<JsgWorkerdIsolate_TypeWrapper>::from(lockParam); | |
auto modules = jsg::ModuleRegistryImpl<JsgWorkerdIsolate_TypeWrapper>::from(lockParam); |
We've added ~100 lines of Python-only logic to compileModules which is otherwise only ~30 lines long. I moved it into a separate function.