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.
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
Standardize python setup, ensure homu gets python3 #148
Standardize python setup, ensure homu gets python3 #148
Changes from 1 commit
e2a8efcb4e4b52a3baeaaFile filter...
Jump to…
Standardize python setup, ensure homu gets python3
ManishearthFeb 11, 2016
MemberManishearthNov 4, 2015
MemberIn my experience I needed to
pip3 install virtualenvbefore I got virtualenv3. Should we make two keys here, one withbin_env: pipand one withbin_env: pip3?aneeshusaNov 4, 2015
Author MemberI just tested this in a fresh vagrant box. It started out without pip or virtualenv (any version). I ran
sudo apt-get install python-pipsudo pip install virtualenvThis created
/usr/local/bin/virtualenvand/usr/local/bin/virtualenv-3.4executables, the latter of which works fine for the homu venv - I peeked inside the vagrant box and the homu venv had python3 and pip3.bin_env is used when you want to run pip inside a virtualenv, such as in
homu/init.sls, so I'm not sure what you are proposing with the two keys. Could you please clarify?ManishearthNov 4, 2015
MemberAre the default python/pip/virtualenv the 2.7 ones?
bin_envis for both selecting a virtualenv or selecting a custom binary to run. It lets you say "Install this pip package, but use thepip3.4binary". https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.pip.htmlaneeshusaNov 4, 2015
Author MemberYes, on Ubuntu the defaults are all 2.7. Ubuntu is not planning to change this until PEP 394 says otherwise.
bin_env: Right, I'm using this but in a different way. The approach I'm taking is to usevirtualenv.managedand pass in python3 inhomu/init.sls; salt automatically will install pip3 in the virtualenv (pip3 is bundled with python starting with python3.4). Then, I use pip.installed and setbin_envto the virtualenv location for homu's dependencies, which means it ends up using pip3 under the hood.Also, for future reference you'll want to use the state documentation, not the module docs :)
ManishearthNov 4, 2015
MemberOkay, sounds good. So when you say
python: python3in the homu setup below, does that mean that it will also usevirtualenv3? Because homu doesn't even install properly with an older virtualenv version, it needs to use pip3, python3, and virtualenv3. (Not sure if virtualenv2 even lets you create a python3 env, but it's good to be certain)aneeshusaNov 4, 2015
Author Member@Manishearth the
venv_binoption is what tells salt to use virtualenv-3.4, and thepythonoption tells virtualenv to install python3 (and pip3) inside the virtualenv.ManishearthNov 4, 2015
MemberOh, right, I didn't notice that, sorry😄