Add plugin support to the installer

TLJH is a great base to build 'stacks' on top of
for various use cases. These 'stacks' should be built by
people who are domain experts in their fields, and easily
updateable with new TLJH versions. Extension points need
to be very clearly defined & evolvable, so we can modify
TLJH without fear of breaking everything.

[pluggy](https://pluggy.readthedocs.io/) is the plugin
mechanism for pytest spun out into its own library,
and fits our requirements well.

There is an experimental pangeo stack in progress at
https://github.com/yuvipanda/tljh-pangeo for an example
of how this would work
This commit is contained in:
yuvipanda
2018-08-11 00:42:28 -07:00
parent 258e350abc
commit d12345e72a
3 changed files with 83 additions and 3 deletions

33
tljh/hooks.py Normal file
View File

@@ -0,0 +1,33 @@
"""
Hook specifications that pluggy plugins can override
"""
import pluggy
hookspec = pluggy.HookspecMarker('tljh')
hookimpl = pluggy.HookimplMarker('tljh')
@hookspec
def tljh_extra_user_conda_packages():
"""
Return list of extra conda packages to install in user environment.
"""
pass
@hookspec
def tljh_extra_user_pip_packages():
"""
Return list of extra pip packages to install in user environment.
"""
pass
@hookspec
def tljh_extra_apt_packages():
"""
Return list of extra apt packages to install in the user environment.
These will be installed before additional pip or conda packages.
"""
pass