Update pack install action so it works correctly when --python3 flag and "python_versions" pack.yaml attribute is used #4662
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request updates / fixes
packs.install
action (andst2-pack-install
binary) so it works correctly whenpack.yaml
metadata file includespython_versions
attribute and when--python3
flag is used for installation.Background, Context
In v3.0.0, new
python_versions
attribute was added topack.yaml
. With this attribute pack can declare which Python versions it supports / works with (Python 2.x and Python 3.x). This attribute is used by our Exchange CI to run checks and tests under correct Python versions.In addition to that, it's also used by packs install action and binary. If user tries to install a pack on an unsupported Python version, an error is returned.
In the past, we added
--python3
flag to pack install command. With this command, user can use Python 3 binary for a specific pack when StackStorm itself runs under Python 2. This pull request fixes this functionality so it works correctly when pack metadata specifiespython_versions
attribute.NOTE: Mixing Python 2 and 3 has a lot of edge cases so I also plan to document that (a lot of packs may not work, especially the ones with rely on C extensions, etc.). Once Ubuntu Bionic packages with native Python 3 support go GA we should probably deprecate
--python3
flag or at least make it less prominent.Resolves #4654.