-
-
Notifications
You must be signed in to change notification settings - Fork 745
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
Allow a pack to specify Python 3 and have corresponding virtualenvs use Python 3 #3922
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e014412
add a Python 3 flag to the virtualenv command
tonybaloney 286517e
add config option to sample
tonybaloney 5158257
add the python 3 flag to the config generator
tonybaloney ed9dab3
fix a mixup with bin names and add the sed command to configure the P…
tonybaloney a684978
fix naming issue
tonybaloney 2de634f
read pack meta when deploying virtualenv. check for existence of 'pyt…
tonybaloney 7e69044
change 'make requirements' to default to Python 2.7, since that is th…
tonybaloney a194a16
Add a simple unit test
tonybaloney 9eab587
Add a python 2 test and fix the original one
tonybaloney 48dd14c
Fix assertions
tonybaloney ad1c241
move pack python3 attribute to system namespace
tonybaloney ddf6b3e
Merge branch 'master' into virtualenv_version
tonybaloney 0867a54
update config files after running 'make configgen' needs checking
tonybaloney 624dd57
Merge branch 'virtualenv_version' of github.com:tonybaloney/st2 into …
tonybaloney 2e4e080
Merge branch 'master' into virtualenv_version
tonybaloney c9a5716
Merge branch 'master' into virtualenv_version
tonybaloney File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ mask_secrets = True | |
|
||
[system_user] | ||
user = stanley | ||
ssh_key_file = /home/vagrant/.ssh/stanley_rsa | ||
ssh_key_file = /home/stanley/.ssh/stanley_rsa | ||
|
||
[messaging] | ||
url = amqp://guest:[email protected]:5672/ | ||
|
@@ -110,4 +110,4 @@ v2_base_url = http://127.0.0.1:8989/v2 | |
jitter_interval = 0 | ||
|
||
[packs] | ||
enable_common_libs = True | ||
enable_common_libs = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps, for dependency injection and testing reasons, this function should take
use_python3
as an argument instead of reading the metadata file itself.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking out loud - I first thought this might slow down things quite a bit when running
st2ctl register --register-setup-virtualenvs
flag because we now also need to read and parse metadata file for each pack.But after some more thought - we already need to do that, so another read and parse shouldn't add too much overhead since file should already be in filesystem cache. Future optimization would perhaps be to refactor the code a bit so we don't need to read and parse metadata file multiple times, but probably not needed right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assumed that the pack would still install if the meta-file wasn't in place, so I didn't want to alter the original behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metadata is mandatory so it would fail at some other step, but that's not really important here and I'm fine with the current approach.
I was mostly just "thinking out loud" about the potential performance overhead from reading and parsing pack metadata multiple times during install phase :)