But this would not work for a custom python environment. If I have to use some popular modules like requests, I would have to bundle my own modules and those I would normally add as a dependency in a custom env, which mean I'd have to update them all manually somewhere in the future.
This is an approach I was looking for though - create you own modules from python functions, and upload them into the custom environment, so every action that runs in that env can use it.
I think I will settle for a "wrapper" function written in js for now, that would load all configuration elements and resource elements in the first step, and pass the values on to python actions, which would be referenced by the traditional System.getModule("my.py.actions") method.