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

pip ensure=>latest fails with pip>=20.3.0

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 6.21.1
    • Fix Version/s: PUP 6.24.0, PUP 7.9.0
    • Component/s: None
    • Labels:
    • Template:
      PUP Bug Template
    • Team:
      Night's Watch
    • Story Points:
      2
    • Sprint:
      NW - 2021-07-14
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      Starting with version 20.3b1, `pip` removed ability to list available versions of a package. This fix adds the `--use-deprecated=legacy-resolver` argument when querying available versions of a package with affected versions of `pip`.
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 6.21.1
      Puppet Server Version: 6.15.1
      OS Name/Version: Ubuntu 18.04 and MacOS 10.15

      Desired Behavior:

      A package is installed:

      package { 'my_package':
        ensure => latest,
        provider => 'pip3',
        install_options => [ '--extra-index-url', 'http://artifactory.mydomain.com:8081/artifactory/api/pypi/pypi-virtual/simple',
      '--trusted-host', 'artifactory.mydomain.com' ],
      }
      

      Normal behavior is that puppet keeps this package updated to latest.

      Actual Behavior:

      This fails. I believe the failure is due to a change in the output of pip when ==versionplease is used:

      looks like a change in behavior after pip20.2.4 (so 20.3 and 21). Previously if you sent a weird version (like my_package==versionplease) you would get a result like this:

      Looking in indexes: [https://pypi.org/simple], [http://artifactory.mydomain.com:8081/artifactory/api/pypi/pypi-virtual/simple|http://artifactory.arxan.com:8081/artifactory/api/pypi/pypi-virtual/simple]
      ERROR: Could not find a version that satisfies the requirement my_package==versionplease (from versions: 2.33.6, 2.33.8, 2.33.9, 2.33.112, 2.34.7, 2.34.113, 2.34.114, 2.34.115, 2.35.116, 2.35.117, 2.35.118, 2.35.119, 2.35.120, 2.35.121, 2.35.122, 2.35.123, 2.35.124, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5, 3.0.6, 3.0.7, 3.0.8, 3.0.9, 3.0.125, 3.0.126, 3.0.127, 3.0.128, 3.0.129, 3.0.130, 3.0.131, 3.0.132, 3.0.138, 3.0.139, 3.0.143, 3.0.146, 3.0.147, 3.0.148, 3.0.149, 3.0.153, 3.0.154, 3.0.156, 3.0.157, 3.0.159, 3.0.160, 3.0.161, 3.0.162, 3.0.163, 3.0.164, 3.0.165, 3.0.166, 3.0.167, 3.0.168, 3.0.169, 3.0.170, 3.0.171, 3.0.172, 3.1.10, 3.1.11, 3.1.12, 3.1.13, 3.1.17, 3.1.20, 3.1.21, 3.1.22, 3.1.23, 3.1.24, 3.2.25, 3.2.26, 3.2.27, 3.2.28, 3.2.35, 3.2.36, 3.2.37, 3.2.38, 3.2.39, 3.2.40, 3.2.41, 3.2.42, 3.2.43, 3.2.44, 3.2.45, 3.2.46, 3.2.47, 3.2.48, 3.2.49, 3.2.50, 3.2.51, 3.2.52, 3.2.53, 3.2.56, 3.2.59, 3.2.64, 3.2.65, 3.2.66, 3.2.74, 3.2.75, 3.2.83, 3.2.87, 3.2.88, 3.2.89, 3.2.90, 3.2.92, 3.2.94, 3.2.97, 3.2.99, 3.2.102, 3.2.104, 3.2.116, 3.2.118, 3.2.119, 3.2.121, 3.2.123, 3.2.125, 3.2.127, 3.2.131, 3.2.136, 3.2.138, 3.2.159, 3.2.163, 4.0.168, 4.0.170, 4.0.171, 4.0.173, 4.0.175, 4.0.176, 4.0.177, 4.0.178, 4.0.179, 4.0.182, 4.0.183, 4.0.187, 4.0.189, 4.0.190, 4.0.191, 4.0.192, 4.0.193, 4.0.196, 4.0.197, 4.0.198, 4.0.199, 4.0.203, 4.0.226, 4.0.228, 4.0.230, 4.0.234, 4.0.235, 4.0.236, 4.0.237, 4.0.239, 4.0.240, 4.0.242, 4.0.243, 4.0.244, 4.0.245, 4.0.246, 4.0.248, 4.0.276, 4.0.277, 4.0.278, 4.0.279, 4.0.280, 4.0.281, 4.0.282, 4.0.299, 4.0.300, 4.0.309, 4.0.315, 4.0.316, 4.0.319, 4.0.328, 4.0.329, 4.0.333, 4.0.334, 5.335, 6.0.13, 6.0.14, 6.0.15, 6.0.16, 6.0.19, 6.0.20, 6.0.22, 6.0.336, 6.0.337, 6.0.338, 6.0.340, 6.0.351, 6.0.352, 6.0.353, 6.0.355, 6.0.357, 6.0.362, 6.0.363, 6.0.366, 6.0.368, 6.0.369, 6.0.370, 6.0.374, 6.1.27, 6.1.28, 6.1.29, 6.1.30, 6.1.31, 6.1.33, 6.1.34, 6.1.35, 6.1.37, 7.0.48, 7.0.49, 7.0.50, 7.0.51, 7.0.54, 7.0.55, 7.0.56, 7.0.58, 7.0.59, 7.0.62, 7.0.64, 7.0.65, 7.0.66, 7.0.67, 7.0.68, 7.0.70, 7.0.73, 7.0.74, 7.0.76, 7.0.78, 7.0.81, 7.0.82, 7.0.84, 7.0.85, 7.0.86, 7.0.88, 7.0.89, 7.0.91, 7.0.93, 7.0.96, 7.0.97, 7.0.98, 7.0.99, 7.0.105, 7.0.106)
      ERROR: No matching distribution found for my_package==versionplease
      

      After 20.3 you get this:

      Looking in indexes: [https://pypi.org/simple], [http://artifactory.my_domain.com:8081/artifactory/api/pypi/pypi-virtual/simple|http://artifactory.arxan.com:8081/artifactory/api/pypi/pypi-virtual/simple]
      ERROR: Could not find a version that satisfies the requirement my_package==versionplease
      ERROR: No matching distribution found for my_package==versionplease
      

      So puppet's parsing to figure out if it needs to install a new version to satisfy 'ensure => latest' doesn't work. This is using puppet 6.21.1. Backing down to pip==20.2.4 gets everything working again.

        Attachments

          Activity

            People

            Assignee:
            luchian.nemes Luchian Nemes
            Reporter:
            sames@digital.ai Steve Ames
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support