Open krrome opened 4 years ago
This is a great request. There are a couple of ways to do it, as you say. I'll have a think. One (maybe easy) way that comes to mind is to change the PYTHONPATH when user Python modules are imported - _load_module
in machine/foreign.py
. I think this is what your first option is suggesting.
I think the practical problem is actually bigger than how to load user libraries in machine... If there are version conflicts then poetry add hark-lang
during project setup will already stop the user from progressing. I'm putting down what I think the options are when keeping hark implemented in python:
Using separate environments
Using the same environment for hark and for the user code and executing user code inside the hark python process
Is your feature request related to a problem? Please describe. In order to generalise it will be necessary for users to bring their own requirements, python versions etc.
An example - at the moment when you setup a project and you do:
Then you try to install your custom package which requires e.g.: "pyyaml==5.1.1" for whatever reason then
poetry add ./src/ext/my_other_package
will fail with:Describe the solution you'd like Lose the restrictions by hark-lang requirements
Describe alternatives you've considered To make the hark-lang runtime environment independent from the user's runtime environment it will be required to call user defined python functions "outside" of the hark-lang python process. Some options that come to mind: