st2docs
st2docs copied to clipboard
Structuring Python Actions of Med/High Complexity
Several folks on the community slack channel have asked about relative imports for Python actions, thinking that we were doing something funky with PYTHONPATH.
Need to document the existing behavior wrt PYTHONPATH, and some best practices around structuring code that exceeds a single file
- How to do relative imports, including when the relative import must use
..to go up a directory - When it's a good idea to put your code in a separate lib and upload to pypi (and some pointers to this)
Just generally need to provide some guidance for those that have more than a simple file for a Python action, and may not know how to properly structure it.