Skip to content

pip package performing install on every run with underscore in name #743

Description

@tindelli

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 8
  • Ruby: 3.2.9
  • Distribution: Debian 13 (client/agent)
  • Module version: 8.0.0
  • Python 3.13 (system packages)
  • pip 25.3

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

Using hiera:

python::python_pyvenvs:
  '/opt/venv':
    version: '3.13'
python::python_pips:
  'astropy_healpix':
    virtualenv: '/opt/venv'
    ensure: latest
python::venv: present
python::version: '3.13'

What are you seeing

pip install is run on every puppet run:

What behaviour did you expect instead

pip install should not be run if the latest version is already installed.

Output log

Debug: Exec[pip_install_astropy_healpix](provider=shell): Executing check '["/bin/sh", "-c", "[ $(/opt/venv/bin/pip --log /opt/venv/pip.log install       'astropy_healpix==9!0dev0+x' 2>&1 | sed -nE 's/.*\\(from versions: (.*, )*(.*)\\)/\\2/p' | tr -d \"[:space:]\") = $(/opt/venv/bin/pip freeze --all | grep -i -e ^astropy-healpix== | cut -d= -f3 | tr -d '[:space:]') ]"]'
Debug: Executing with uid=root gid=root: '/bin/sh -c [ $(/opt/venv/bin/pip --log /opt/venv/pip.log install       'astropy_healpix==9!0dev0+x' 2>&1 | sed -nE 's/.*\(from versions: (.*, )*(.*)\)/\2/p' | tr -d "[:space:]") = $(/opt/venv/bin/pip freeze --all | grep -i -e ^astropy-healpix== | cut -d= -f3 | tr -d '[:space:]') ]'
Debug: /Stage[main]/Python/Python::Pip[astropy_healpix]/Exec[pip_install_astropy_healpix]/unless: /bin/sh: 1: [: =: argument expected
Debug: Exec[pip_install_astropy_healpix](provider=shell): Executing '["/bin/sh", "-c", "/opt/venv/bin/pip --log /opt/venv/pip.log install --upgrade      astropy_healpix"]'
Debug: Executing with uid=root gid=root: '/bin/sh -c /opt/venv/bin/pip --log /opt/venv/pip.log install --upgrade      astropy_healpix'
Notice: /Stage[main]/Python/Python::Pip[astropy_healpix]/Exec[pip_install_astropy_healpix]/returns: executed successfully (corrective)

Any additional information you'd like to impart

Based on the comments in manifests/pip.pp, it looks like pip freeze used to replace underscores with dashes. That seems to no longer be the case beginning in pip 21.2.

pip 20.3.4 / python 3.9

# pip install typing_extensions
Collecting typing_extensions
  Downloading typing_extensions-4.15.0-py3-none-any.whl (44 kB)
     |████████████████████████████████| 44 kB 7.9 MB/s
Installing collected packages: typing-extensions
Successfully installed typing-extensions-4.15.0

# pip list | grep 'typing.extensions'
typing-extensions  4.15.0

# pip freeze | grep 'typing.extensions'
typing-extensions==4.15.0

pip 21.1.3 / python 3.9

# pip list | grep 'typing.extensions'
typing-extensions    4.15.0

# pip freeze | grep 'typing.extensions'
typing-extensions==4.15.0

pip 21.2 / python 3.9

# pip list | grep 'typing.extensions'
typing_extensions    4.15.0

# pip freeze | grep 'typing.extensions'
typing_extensions==4.15.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions