voxpupuli / puppet-python

Puppet module for installing and managing Python, pip, virtualenvs and Gunicorn virtual hosts.
https://forge.puppetlabs.com/puppet/python
Apache License 2.0
199 stars 370 forks source link

Package with provider pip3 tries installing every run. #626

Closed maltewhiite closed 2 years ago

maltewhiite commented 2 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

package { ['regex', 'argparse', 'configparser', 'prometheus-client',]:
    ensure   => installed,
    provider => pip3,
  }

What are you seeing

Package[argparse]/ensure: created (corrective) on every run of puppet

What behaviour did you expect instead

That because the package is installed, it won't try to install it every time.

Any additional information you'd like to impart

Please make it so pip3 provider for packages, doesn't trigger a Package[argparse]/ensure: created (corrective) line every time. It is bad for our foreman monitoring. The hosts never reach a stable state. They always have: Hosts that had performed modifications without error

If I run "pip3 install argparse" plainly, this is the result:

pip3 install argparse
WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
Requirement already satisfied: argparse in /usr/local/lib/python3.6/site-packages
smortex commented 2 years ago

argparse seems to support Python up to 3.4. Project was abandoned upstream, see: https://github.com/ThomasWaldmann/argparse/

Conflict with argparse of stdlib?

maltewhiite commented 2 years ago

@smortex

Thanks. Resolved my issue by just doing like so:

  # PROMETHEUS
  package { ['regex', 'configparser', 'prometheus-client', ]:
    ensure          => installed,
    provider        => pip3,
    install_options => '-q',
  }

We are using Python 2.7.5, so Argparse was supported natively, as you said. I was not aware. Thanks.