Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-11075

Pip provider on Windows does not work correclty with wheel files

    XMLWordPrintable

Details

    • Bug
    • Status: Accepted
    • Normal
    • Resolution: Unresolved
    • PUP 7.6.0
    • None
    • Windows
    • ready for triage
    • Needs Assessment
    • Needs Assessment

    Description

      Hello,

       

      Pip provider is not working correctly on Windows when using WHL file.

      Consider the following snippet:

      package { 'GDAL':
        ensure   => '3.2.3',
        provider => 'pip',
        install_options => ['https://download.lfd.uci.edu/pythonlibs/q4trcu4l/GDAL-3.2.3-cp37-cp37m-win_amd64.whl'],
      }
      

      It will install the module just fine but fails to understand it's installed.

      Running "puppet resource package" shows no information about the GDAL package.

      The reason is quite easy to understand once you've digged into Puppet code.

      https://github.com/puppetlabs/puppet/blob/main/lib/puppet/provider/package/pip.rb#L63

      Puppet agent runs pip freeze --all which returns:

      certifi==2020.12.5
      chardet==4.0.0
      GDAL @ file:///C:/Users/earthlab/GDAL-3.2.3-cp37-cp37m-win_amd64.whl
      idna==2.10
      numpy==1.20.3
      pika==1.0.1
      pip==20.1.1
      python-dateutil==2.8.1
      PyYAML==5.4.1
      requests==2.25.1
      setuptools==47.1.0
      six==1.16.0
      urllib3==1.26.4
      

      As you can see GDAL version is not reported, but replace by the WHL file URL.

      This "bug" has been discussed here:

      https://github.com/pypa/pip/issues/8176

      My understanding is that it used to work correctly with pip before https://www.python.org/dev/peps/pep-0610/ has been implemented but newer version broke the output. Command has to be changed to pip list --format=freeze which returns:

      certifi==2020.12.5
      chardet==4.0.0
      GDAL==3.2.3
      idna==2.10
      numpy==1.20.3
      pika==1.0.1
      pip==20.1.1
      python-dateutil==2.8.1
      PyYAML==5.4.1
      requests==2.25.1
      setuptools==47.1.0
      six==1.16.0
      urllib3==1.26.4
      

      From my understanding, pip list --format=freeze should be the one being used.

       

      Best regards, Adam.

      Attachments

        Activity

          People

            Unassigned Unassigned
            acecileletz Adam Cecile
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Zendesk Support