Stream: wasm

Topic: componentize-py guest with pypi dependencies?


view this post on Zulip Ramon Klass (May 23 2023 at 12:03):

can componentize-py bundle requirements? I'm thinking something along the lines of providing a virtualenv where the pure python packages the guest depends on are installed, but I'm unsure if that would work. Is this currently possible?

probably a question mainly for Joel :)

view this post on Zulip Joel Dice (May 23 2023 at 13:44):

Yes, it can! If you're using pipenv to manage your dependencies, componentize-py should pick them up automatically: https://github.com/dicej/componentize-py/blob/a5437cf203321962df83afe449349e61762021a1/src/command.rs#L126-L153. For example the toml package is pure Python, so you can pipenv install toml and use it in your app with import toml, and componentize-py should bundle it automatically. If you're using a different tool to manage dependencies, you'll need to explicitly tell componentize-py where they are on the host filesystem using --python-path.
BTW, as of yesterday, you can now pip install componentize-py, which hopefully makes it easier to experiment with.

Contribute to dicej/componentize-py development by creating an account on GitHub.

view this post on Zulip Ramon Klass (May 23 2023 at 14:18):

oh that is good to know, having it on pypi is lowering the burden of entry greatly for my pythonic coworkers who are trying to get their feet wet ;)

view this post on Zulip Ramon Klass (May 23 2023 at 14:19):

thank you, I'll try with pipenv :)

view this post on Zulip Brett Cannon (May 23 2023 at 22:47):

@Joel Dice I would be careful about hard-coding installation tool support as pipenv is only one of multiple tools in the Python community (and it's not even the most popular).

view this post on Zulip Joel Dice (May 23 2023 at 22:48):

Would you recommend removing that support or adding support for others (or both)?

view this post on Zulip Brett Cannon (May 23 2023 at 22:49):

We can talk about it on Thursday; depends on how much work you want to do and if you want to try and keep up with the Python packaging ecosystem :sweat_smile:


Last updated: Dec 23 2024 at 12:05 UTC