<#2149 Duplicate constraints sometimes ignored> Is...
# github-notifications
c
#2149 Duplicate constraints sometimes ignored Issue created by tgolsson Hello, Runnable repro: https://github.com/tgolsson/pants-repros/tree/main/sentry-lost-constraint As the readme there says, Pants 2.15.0 + Pex v2.1.129 is randomly failing to lock correctly. Sentry has the following constraints for urllib3:
Copy code
[
            "urllib3<2.0.0",
            "urllib3>=1.25.7; python_version <= \"3.4\"",
            "urllib3>=1.26.11; python_version >= \"3.6\"",
            "urllib3>=1.26.9; python_version == \"3.5\""
        ]
But the lockfile will (randomly) resolve with the below for urllib3. Note that the locked version is 2.0.2. The other version it will find is 1.26.15, which is permissible with all constraints. I've not tested extensively but it seems to be 50/50 which one it ends up locking, with no huge bias to either one. I didn't see anything in the changelog from the few latest releases that would affect this.
Copy code
"artifacts": [
            {
              "algorithm": "sha256",
              "hash": "d055c2f9d38dc53c808f6fdc8eab7360b6fdbbde02340ed25cfbcd817c62469e",
              "url": "<https://files.pythonhosted.org/packages/4b/1d/f8383ef593114755429c307449e7717b87044b3bcd5f7860b89b1f759e34/urllib3-2.0.2-py3-none-any.whl>"
            },
            {
              "algorithm": "sha256",
              "hash": "61717a1095d7e155cdb737ac7bb2f4324a858a1e2e6466f6d03ff630ca68d3cc",
              "url": "<https://files.pythonhosted.org/packages/fb/c0/1abba1a1233b81cf2e36f56e05194f5e8a0cec8c03c244cab56cc9dfb5bd/urllib3-2.0.2.tar.gz>"
            }
          ],
pantsbuild/pex