-
-
Notifications
You must be signed in to change notification settings - Fork 19
Description
It is not possible to "install" Basilisp's import hooks via Poetry as far as I can tell, because Poetry doesn't offer any post-install hooks for packages (likely for the better to prohibit arbitrary code execution during package installation!). At any rate, there are some other options offered for in our documentation for how to "bootstrap" a Basilisp application from Python code, but all require a bit of a Python wrapper to get into the Lisp code.
One option for us is to install a .pth file into the site-packages directory which allows subsequent invocations of the Python interpreter to have the import hooks (and basilisp.core) automatically available. However, since that cannot be done via poetry the next best option would be to provide a CLI command to do this. Users could do this once during an installation and all subsequent invocations of the Python interpreter would be bootstrapped.
I did also consider using something like sitecustomize-entrypoints which is a fairly clever package that takes advantage of setuptools/importlib.metadata entrypoints and installs itself as the sole sitecustomize in the site-packages directory to allow multiple packages to register for sitecustomize hooks. I'm not entirely against the idea, but I was not interested in installing an additional dependency into Basilisp for now. If the CLI command proposed above proves problematic, we could always reconsider the sitecustomize-entrypoints package.