cloudflare / python-workers-examples

Apache License 2.0
106 stars 19 forks source link

Suggestion #17

Open vibheksoni opened 5 days ago

vibheksoni commented 5 days ago

Currently, we can't use external required modules. To avoid installing them, I was wondering if we could leverage importlib.util.import_module to load dependencies instead. This approach would enable package loading without external dependencies, which could be beneficial. What are your thoughts on this potential solution?

hoodmane commented 5 days ago

Well import_module uses the same resolution logic as an actual import statement so I don't think this helps much. Either way, you need to get the files that constitute the package into your worker. It's currently possible to vendor packages, it's just not very user friendly.