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

Problem with pip - 'latest' and parse from freeze options

Open marcinbojko opened this issue 8 years ago • 3 comments
trafficstars

  1. Simple configuration:
python:
    dev: latest
    pip: latest
    python_pips:
      erl_terms:
        ensure: 0.1.1
        pkgname: erl_terms
      psutil:
        pkgname: psutil

CentOS 7.2/7.3

Using pip 'latest' doesn't work. Pip stays at 8.1.2.

  1. Parse unless with pip freeze

In your 'unless' statement, exemplary phrase: pip freeze | grep -i -e ^erl_terms==0.1.1$ || pip list | sed -e 's/[ ]\+/==/' -e 's/[()]//g' | grep -i -e ^erl_terms==0.1.1 will always return notify due to:

You are using pip version 8.1.2, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command. You are using pip version 8.1.2, however version 9.0.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.

After manual upgrade pip to 9.0.1, notify changes to:

DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning. This still generates notify event and installs pips on every puppet run.

marcinbojko avatar Jan 05 '17 07:01 marcinbojko

I have the same issue. My workaround:

python::pip { 'pip':
  ensure => '9.0.1',      
  install_args => `'--upgrade',
}

Mortinke avatar Feb 14 '17 07:02 Mortinke

In my case pip argument requires a string not a hash, so no way to use workaround.

marcinbojko avatar Feb 14 '17 07:02 marcinbojko

I'm not certain if it works for all version of pip , but using 'pip -q freeze | grep ...' quashes the 'consider upgrading' noise so that the behaviour of Exec[ ] with unless works like intended

bramblek1 avatar Mar 16 '17 04:03 bramblek1