Project

General

Profile

Bug #17341

Upgrading a pip package with Puppet doesn't work

Added by zen about 1 month ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Normal
Assignee:
Sysadmins
Category:
Infrastructure
Target version:
-
Start date:
Due date:
% Done:

0%

Feature Branch:
Type of work:
Sysadmin
Blueprint:
Starter:
Affected tool:

Description

We're currently using a defined resource type for installing pip packages in the system. When there's a new version, it doesn't upgrade, and keeps the current version already installed. We have to check how to deal with pip's vcs support to actually upgrade.

One possible option is to uninstall before installing.

History

#1 Updated by intrigeri about 1 month ago

I'm curious wrt. "When there's a new version, it doesn't upgrade": does it try to upgrade and fails, or is it that our unless clause erroneously returns true, thus blocking the upgrade?

In passing, https://github.com/voxpupuli/puppet-python/blob/master/manifests/pip.pp seems to support installing from Git (while Puppet's own pip provider does not IIRC).

#2 Updated by zen about 1 month ago

  • Status changed from Confirmed to Resolved

intrigeri wrote:

I'm curious wrt. "When there's a new version, it doesn't upgrade": does it try to upgrade and fails, or is it that our unless clause erroneously returns true, thus blocking the upgrade?

Our unless clause is fine, and puppet correctly tries to upgrade the package, but pip's behavior is a bit odd and the upgrade doesn't finish.

The behavior is: when installing from URL a package that is already installed, pip doesn't upgrade, even if you pass it the option --force-reinstall. I would have to dive in the code and compare with documentation to know if that's a bug.

So the trick was to use pip3 install --ignore-installed, which forces a reinstall: https://git.tails.boum.org/puppet-tails/commit/?id=25af06755a14bb00d18fb594f322eb5afbe067d6

In passing, https://github.com/voxpupuli/puppet-python/blob/master/manifests/pip.pp seems to support installing from Git (while Puppet's own pip provider does not IIRC).

We're not currently using that module, right? Is there an intention to use it at some point?

(i'll close this issue now as it's solved for now, feel free to reopen or open new ones if needed)

#3 Updated by intrigeri about 1 month ago

Hi @zen,

Our unless clause is fine, and puppet correctly tries to upgrade the package, but pip's behavior is a bit odd and the upgrade doesn't finish.

The behavior is: when installing from URL a package that is already installed, pip doesn't upgrade, even if you pass it the option --force-reinstall. I would have to dive in the code and compare with documentation to know if that's a bug.

Wow. That's not exactly obvious from the names of the options :/

So the trick was to use pip3 install --ignore-installed, which forces a reinstall: https://git.tails.boum.org/puppet-tails/commit/?id=25af06755a14bb00d18fb594f322eb5afbe067d6

Ooh yeah!

In passing, https://github.com/voxpupuli/puppet-python/blob/master/manifests/pip.pp seems to support installing from Git (while Puppet's own pip provider does not IIRC).

We're not currently using that module, right? Is there an intention to use it at some point?

No, we're not using it. I mentioned it in case at some point, we grow tired enough of maintaining our own NIH solution, that we get interested in looking at possible greener pastures :)

Also available in: Atom PDF