poise / poise-python

A Chef cookbook to provide a unified interface for installing Python, managing Python packages, and creating virtualenvs.
Apache License 2.0
124 stars 109 forks source link

python_virtualenv doesn't install pip #57

Open jblaine opened 8 years ago

jblaine commented 8 years ago

python_virtualenv with system_site_packages true is not behaving like virtualenv --system-site-packages

  python_runtime '2' do
    provider :system
  end

  python_virtualenv '/tmp/noodle' do
    user 'jblaine'
    system_site_packages true
  end
* python_virtualenv[/tmp/noodle] action create
  - Creating virtualenv at /tmp/noodle
  * python_runtime_pip[/tmp/noodle] action install (up to date)
  * python_package[setuptools] action install (up to date)
  * python_package[wheel] action install (up to date)
tmp:etc-metrics# ls noodle/bin
activate  activate.csh  activate.fish  activate_this.py  python  python2  python2.7  python-config
tmp:etc-metrics#

Contrast with:

tmp:etc-metrics# virtualenv without-poise --system-site-packages
New python executable in /tmp/without-poise/bin/python
Installing setuptools, pip, wheel...done.
tmp:etc-metrics# ls without-poise/bin
activate      activate.fish     easy_install      pip   pip2.7  python2    python-config
activate.csh  activate_this.py  easy_install-2.7  pip2  python  python2.7  wheel
tmp:etc-metrics# rm -rf without-poise/
coderanger commented 8 years ago

Check if the pip module is present, the binary is both not used and unimportant.

jblaine commented 8 years ago

Is it your intention then that a README.md update at some point will indicate that "There will never be a pip filesystem command installed in a python_virtualenv ... and all pip commands must be done via either python_package or python_execute (using a command of -m pip <pip_command_here> <pip_options_here>)" ?

coderanger commented 8 years ago

This is standard usage for pip these days. The PyPA team has actually debated removing the binary because of how error prone it is compared to -m pip. I doubt that will actually happen for compat reasons but certainly never use it anymore.

jblaine commented 7 years ago

I can appreciate discussion of future change, but all of our developers without exception still expect 'pip' to exist, so I respectfully disagree with your opinion that "the binary is both not used and unimportant".

coderanger commented 7 years ago

Sorry, I meant specifically to the cookbook the binary is unimportant. It should be installed and visible normally modulo what provider you're using.