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 108 forks source link

python_package is downgrading wheel installed by poise-python? #105

Open dragon788 opened 6 years ago

dragon788 commented 6 years ago

Oddly when changing our recipe to do a fresh install of pex 1.28 instead of 1.26 our ami_spec tests started failing. After flailing around for a while (the ami_spec output is terrible) I finally discovered that the version of wheel that was getting installed somehow ended up as 0.29.0 instead of the 0.30.0 requested.

python_runtime '2' do
  pip_version true
  setuptools_version true
  virtualenv_version '15.1.0'
  wheel_version '0.30.0'
end

python_package 'pex' do
  version '1.2.8'
end

# At this point the unit tests asserting `pex==1.28` pass, but `wheel==0.30.0` fails.
# This is what I added based on issue #62's suggestion and it *works* but is painful
python_package 'wheel' do
  version '0.30.0'
  action :upgrade
end

I'm not sure how/why it is getting downgraded, but it seems like the version we specified either never gets installed or gets dragged down which doesn't seem like how pip is supposed to behave either, if the requirement is there is should use the existing not perform a downgrade.

coderanger commented 6 years ago

Please include a debug log from Chef, which shows what actual commands got run, that should help track things down.

dragon788 commented 6 years ago

I think I figured out the issue, we've pulled in python_runtime '2' a few places in our cookbooks, and one of the other instances had wheel_version true rather than a specific version, resulting in any checks that only look for the existence and not the version to pass. I'll dig in a little more and see if I can confirm that.