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

epoch confusing version detection #103

Closed ctramnitz closed 6 years ago

ctramnitz commented 6 years ago

I use the quick start method with some slight adjustments:

python_runtime '2' do
  options :system, virtualenv_version: false
end

This works fine on CentOS 7.

However using the same recipe on Fedora 27 (that has both python27 and python36 already installed) I get:

PoiseLanguages::Error: Package python would install 0:2.7.14-4.fc27.x86_64, which does not match 2. Please set the package_name or package_version provider options.

Is the epoch ("0:") confusing poise-python to a point where it thinks 2.7.14 does not match '2'?

coderanger commented 6 years ago

Yeah, might be something with the new dnf support. You can cheat by setting the python_version to '' and using the package_name option to select the right package.

sbcas commented 6 years ago

This symptom is manifesting on CentOS 7 as of the yum rework prior to Chef 14 release. I added a workaround in local dev, and, while it's not optimal, it gets me through my integration runs:

case node['platform_family']
when 'debian', 'ubuntu'
  python_runtime '2' do
    provider :system
  end
when 'rhel'
  python_runtime '0:2' do
    provider :system
  end
end

To me, this suggests that the epoch is now causing sadness and confusion, as, as far as I can tell, I should not need to have this case statement in typical use.

coderanger commented 6 years ago

Fixed in poise-languages 2.1.2.