Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new --python3 flag to st2 pack install CLI command #4016

Merged
merged 9 commits into from
Mar 1, 2018

Conversation

Kami
Copy link
Member

@Kami Kami commented Feb 28, 2018

This pull request adds new --python3 flag to `st2 pack install`` command.

When this flag is provided, virtual environment which is created for a pack uses python3 binary (based on the value of actionrunner.python3_binary config option).

Underneath, it adds python3 parameter to packs.{install,setup_virtualenv} actions.

This pull request builds on top of @tonybaloney's idea in #3922.

We couldn't come up to a consensus in that PR. I thought that approach in that PR is still a bit too invasive until we have CI, etc. in place for packs so we can verify end to end that pack also (or only) works with Python 3.

This pull request goes with a more incremental middle of the ground opt-in approach. If user wishes to use Python 3 for a particular pack they can opt-in. And if things don't go well (stuff doesn't work under Python 3), they can easily recreate virtualenv / reinstall pack with default Python 2 binary.

In the future, we can also build on top of this approach and perhaps utilize pack.yaml metadata attribute to signal if pack additionally / only works with Python 3 as suggested in #3922.

TODO

  • Tests

@Kami Kami added this to the 2.7.0 milestone Feb 28, 2018
@Kami Kami changed the title [WIP] Add new --python3 flag to st2 pack install CLI command Add new --python3 flag to st2 pack install CLI command Feb 28, 2018
Copy link
Contributor

@bigmstone bigmstone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather python3 be python_version, but it's not a blocker. Meaning I'd rather this code be able to handle future versions of python too with minimal changes...but I don't know the likelihood of that being a thing.

@Kami
Copy link
Member Author

Kami commented Feb 28, 2018

@bigmstone Yeah that might change in the future when whole StackStorm platform supports and runs under Python 3 :)

@Kami
Copy link
Member Author

Kami commented Mar 1, 2018

@tonybaloney Hopefully this PR will work as a good compromise until we have the whole platform to run on Python 3 :)

@tonybaloney
Copy link
Contributor

👍

…m:StackStorm/st2 into pack_install_use_python3_binary_parameter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants