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

puppet tries to install latest version of a pip package on every run

Open saz opened this issue 3 years ago • 0 comments
trafficstars

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 6
  • Ruby: 2.7
  • Distribution: Debian Bullseye
  • Module version: 6.3.0

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

ensure_resource('python::pip', 'check-systemd', {'ensure' => 'latest', 'pip_provider' => 'pip3'})

What are you seeing

Puppet tries to install the package on each run

What behaviour did you expect instead

Puppet tries to install the package only once

Output log

Notice: /Stage[main]/Profile::Base::Common/Python::Pip[check-systemd]/Exec[pip_install_check-systemd]/returns: executed successfully (corrective)

Any additional information you'd like to impart

pip changed the dependency resolver in version 20.3. There's more information here: https://stackoverflow.com/a/26664162 As the command to find the latest version is returning an error instead of version numbers, there is no latest version available and that's why puppet tries to install the package on each run

Looks like as if we need to use a different command, depending on the pip version.

pip 20.3.4:

root@machine ~ # pip install --use-deprecated=legacy-resolver check-systemd==
ERROR: Could not find a version that satisfies the requirement check-systemd== (from versions: 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.3.1)
ERROR: No matching distribution found for check-systemd==

pip 20.0.2:

root@machine:~# pip install check-systemd==
ERROR: Could not find a version that satisfies the requirement check-systemd== (from versions: 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.3.1)
ERROR: No matching distribution found for check-systemd==

pip 20.1.1:

root@machine:~# pip install check-systemd==
ERROR: Could not find a version that satisfies the requirement check-systemd== (from versions: 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.3.1)
ERROR: No matching distribution found for check-systemd==

pip 19.1.1:

root@machine:~# pip install check-systemd==
Collecting check-systemd==
  ERROR: Could not find a version that satisfies the requirement check-systemd== (from versions: 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.3.1)
ERROR: No matching distribution found for check-systemd==

pip 22.0.4:

root@machine:~# pip install check-systemd==
ERROR: Could not find a version that satisfies the requirement check-systemd== (from versions: 2.0.1, 2.0.2, 2.0.3, 2.0.4, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.1.0, 2.2.0, 2.2.1, 2.3.0, 2.3.1)
ERROR: No matching distribution found for check-systemd==

saz avatar Jul 21 '22 13:07 saz