As I understand current implementation of auto-install (for NodeJS hooks):
hook.io
spawnshpm-server
hook.io
spawns hook usingmicrocule
- For NodeJS hooks
microcule
spawns it usingrun-service
run-service
catches every error and pass it's JSON representation tostderr
(among other JSON messages)microcule
processesMODULE_NOT_FOUND
errors...- Somehow (
hook.io/lib/resources/packages.js
orhook.io/lib/resources/hook/stderr/index.js
) it passes call toPOST http://localhost:8888/npm/install
ofhpm-server
hpm-server
callshpm.npm.spawn
hpm.npm.spawn
startsinstall-package-npm
install-package-npm
callshpm.npm.install
which callsnpm.commands.install
(usesnpm
as a package)
There should be several changes for python package auto-install:
- Catch of
ImportError
exception. - Implement passing and handling
/pip/install
and/pip3/install
URLs. - Implement
hpm.pip.install
by spawningpip install -t <dir> <pkg>...
orpip3 ...
. - Where should new packages be installed?
/usr/lib/python2.7/dist-packages
?
Additional thoughts about python/python3 implementation at all:
- Exception JSON-ing already implemented in
hook.io-sdk-python
. - There are WSGI standard in python for any web implementations. Sample wrapper for hooks already implemented.
- There are implementation of logging.
- Usually list of dependencies stored in
requirements.txt
file that can be used aspip install -r requirements.txt
. hook.io-sdk-python
API not yet stabilized (I have plan to rewrite it to be more pythonic).
So you need to clarify following questions:
- Should we change python hook processing (which is currently ugly and un-pythonic).
- If yes - what should we add?
a. Only add exceptions JSON-ing
b. (a)+logging init
c. (b)+WSGI wrapper
d. (c)+SDK
- Should
hook.io-sdk-python
be transferred tobigcompany
authority?