indygreg / PyOxidizer

A modern Python application packaging and distribution tool
Mozilla Public License 2.0
5.43k stars 234 forks source link

Customizing embedded kernel #479

Open katetsu opened 2 years ago

katetsu commented 2 years ago

Is it possible to customize an embedded kernel? e.g. install a package.

if yes, should this be done statically before the embedding step or can it also be done dynamically?

indygreg commented 2 years ago

For straight embedding with pyembed, no, there's really no easy way to automate. This is kind of the reason that pyoxidizer exists as a standalone tool.

I would very much like to get things to a point where there are pyoxidizer sub-commands for generating resources artifacts for a given Python package. So you could do e.g. pyoxidizer python-resources-from-pip-install -r requirements.txt and it would spit out a blob that can be referenced by oxidized_importer. But things aren't quite there yet.

katetsu commented 2 years ago

So at this point, if im doing pyoxidizer generate-python-embedding-artifact ..., i cant have e.g.numpy or any other available package be part of the kernel? is there any way to manually do this?

katetsu commented 2 years ago

bump

hamzamohdzubair commented 2 years ago

Any hack or trick in pyoxidizer to make rust applications using pyoxidizer generated artifcacts have a non-stdlib python package?

hamzamohdzubair commented 2 years ago

@indygreg What all needs to be done to get this to work. I might have the time to get some work done for this one, with your help of course.

hamzamohdzubair commented 2 years ago

bump

lethesdomoi commented 5 months ago

Is there a way of doing this, or a workaround that has been found in the last 2 years? Essentially, I would like to be able to embed custom Python artifacts for embedding in a Rust project.

zanieb commented 4 months ago

Please do not bump issues. If you have substantive things to add to the discussion, that's great — if just want the feature, 👍 the first post instead.