Sgtk app, how to import app module from hook

I have a custom app called tk_delivery and I’ve written some base_hooks and hooks and am loading those hooks the “sgtk” way. All is working fine except that I would like to be able to access one of the modules inside my tk_delivery app from the external hook. So my structure inside the app is like this:

app.py
hooks/
  actions/
    action1.py
    action2.py
python/
  tk_delivery/
    delivery.py
    errors.py
    base_hooks/
      action.py

inside action1.py I want to be able to import classes from the errors.py module in my main app but I cant seem to figure out the relative/absolute import pattern needed to do that.

if you attach the errors to the app using something like:

self._errors = tk_delivery.errors

in your app.py

you should then be able to use that in your hook like:

app = self.parent
app._errors.myErrorFunctionOrClass

This is written freehand so you may need to alter this somewhat but thats how I see this mostly done in the app.py, for example tk-multi-publish2 is a good one to reference.