Giter Site home page Giter Site logo

Comments (4)

zebulon501 avatar zebulon501 commented on September 25, 2024

It seems to me that it is quite easy to embed Python in any spk, simply add a dependency on it, and it will get built. Then add your own additional package. This should work, but is not my preferred solution.

Being able to use the standard python spk while embedding additional module would be far better. That would imply to have access to the (a part of) the build tree of the corresponding python spk to be able to invoke the module's setup.py, and to extract only the additional part. A python shell trampoline might also be needed to add this additional site-package directory to the PYTHON_PATH variable.

PS: your workaround is not that good, as is mk/spksrc.python-module.mk. I see potential troubles there.

from spksrc.

Diaoul avatar Diaoul commented on September 25, 2024

The problem is that some scripts may use python without the required PYTHONPATH. The idea would be to add a custom lib dir to the python sys.path rather than at execution time in PYTHONPATH.

Don't know if this is possible, AFAIK sitecustomize.py allow some customization but may be hard to manipulate. This would imply regexps to edit it...
Can't find many examples on this subject. http://docs.python.org/library/site.html

from spksrc.

Diaoul avatar Diaoul commented on September 25, 2024

I went for the easiest solution: embed python in the SPK as a dependency.
If we want to embed say, speechd python module, in the default Python SPK, this will be of no use without the actual speech-dispatcher binary and include speech-dispatcher in the python SPK is not a good idea as it has nothing to do with python (well, except a dedicated module).

However, I go for including all common python modules with C extensions in the python SPK (pyaudio, lxml, and others)

Pure python modules should not even be in cross and should be bundled with the dedicated SPK. pip bundle can do that and I'm working on it so a new SPK should be out soon.

from spksrc.

zebulon501 avatar zebulon501 commented on September 25, 2024

I agree with you, keeping more generic python modules in the main python spk, and embedding python for very specific needs. The bad thing is that it will consume more RAM on our NAS, as the two python executable are different files and the code section can't be saved.

from spksrc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.