puppet-python icon indicating copy to clipboard operation
puppet-python copied to clipboard

Discussion: should dev package be uninstalled by default?

Open faxm0dem opened this issue 10 years ago • 13 comments
trafficstars

I find it very surprising that the following code would uninstall the python-devel package:

include python

I believe there should be three possible outcomes of the dev parameter:

  • true ⇒ ensure present
  • false ⇒ ensure absent
  • undef (default) ⇒ noop

faxm0dem avatar Jan 05 '15 09:01 faxm0dem

agreed. especially given how perfectly useless pip/virtualenv, etc… are without python-devel, i'd assume 'true' to be default.

igalic avatar Jan 05 '15 15:01 igalic

I have no problem with true being the default

faxm0dem avatar Jan 06 '15 10:01 faxm0dem

An additional reason for this is that, at least under Centos 7, python-virtualenv depends on python-devel so if you set virtualenv to true when you call the python class but don't set dev to true

  • The first puppet run
    • puppet sees that python-devel is not installed and so doesn't try to uninstall it
    • puppet installs python-virtualenv which also installs python-devel as it is a dependency
  • The second puppet run
    • puppet sees that python-devel is installed and attempts to uninstall it
    • this fails as it's a dependency of python-virtualenv

gene1wood avatar May 29 '15 17:05 gene1wood

Let me know if the bug till exists.

shivapoudel avatar Jul 21 '15 14:07 shivapoudel

@shivapoudel are you referring to some change which fixes this?

faxm0dem avatar Jul 21 '15 15:07 faxm0dem

@gene1wood can you look for this :P

shivapoudel avatar Jul 21 '15 15:07 shivapoudel

@faxm0dem I have reopened the issue, are you interested in PR for this fix.

shivapoudel avatar Jul 21 '15 15:07 shivapoudel

Sure thing, does everyone agree that $dev = true be the default?

faxm0dem avatar Jul 21 '15 15:07 faxm0dem

@faxm0dem for me its ok.

shivapoudel avatar Jul 21 '15 15:07 shivapoudel

I think the cleanest solution would be the default behavior to neither install nor uninstall python-devel but just leave it as it is (unless it's a dependency for something like virtualenv).

However if this is complicated to implement or feels confusing (to default to noop), then ya, $dev = true sounds fine to me (can't think of an instance where someone would have a problem with install the devel package other than a system with very little disk space)

gene1wood avatar Jul 21 '15 15:07 gene1wood

@shivapoudel Once there's a PR I can try removing my workaround code and see if the PR fixes this in Centos 7

gene1wood avatar Jul 21 '15 15:07 gene1wood

I think the cleanest solution would be the default behavior to neither install nor uninstall python-devel but just leave it as it is (unless it's a dependency for something like virtualenv).

I agree with @gene1wood. I manage some very simple virtualenv which don't need python-dev installation. I prefer to keep it uninstalled.

daks avatar Aug 20 '15 09:08 daks

Okay then, I'll queue this on my TODO

faxm0dem avatar Aug 20 '15 11:08 faxm0dem