This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.

⚠️ We've moved!

Hi there!

To reduce project dependency on 3rd party paid services the StackStorm TSC has decided to move the Q/A from this forum to Github Discussions. This will make user experience better integrated with the native Github flow, as well as the questions closer to the community where they can provide answers.

Use 🔗 Github Discussions to ask your questions.

Develop with python3 virtualenv within docker

Hi there!
Has anyone tried developing Python Actions inside a stackstorm VM or the Docker image?
I’m currently attaching VisualStudio Code to the running container (with the Remote Development Extension), such that I can write new Actions without imports being underlined as errors, and to get ‘autocomplete’ for the Python package st2common contents.
To do that, I also configured the Pythonpath to /opt/stackstorm/st2/bin/python. If I see correctly, this is Python 2.7 (according to python --version) so I was wondering whether there’s also virtualenv with Python 3 for this sort of development setup? The StackStorm version is 3.1.0, so Actions with Python 3 should be supported, if I see this correctly in the StackStorm roadmap.
Feedback, questions and comments are very welcome :slight_smile:

Alternatively, it would be very nice to have a st2common python 3 package available via PyPI – I couldn’t find this so far and would greatly appreciate any pointers. (Developing in the st2 venv makes dependency management unpleasant, at least I’ve not found a good solution so far. Also this requires to backport the existing Action code from Python 3.6 to Python 2.7; apart from convenience, it would be nice to find a solution for this since Python 2.7 will be EOL at the end of this year.)

How have others dealt with this? Have you ignored the import errors while developing custom Python actions?

While the question about the ideal dependency management remains partially unresolved for me, I’ve now found the crucial piece of documentation regarding Python 3 virtual environments.