salmon-barista-63163
05/13/2021, 4:34 PM16:27:19 [ERROR] Failed to resolve compatible distributions:
1: uvicorn==0.13.3 requires click==7.* but click 8.0.0 was resolved
This is when i run a test.pytest
goal with ::
specified as the target. We have hundreds of build files so this is not easy to find where the culprit is. I know i can fix this with constraints.txt but I need to know what specific BUILD file is causing this. Is there a way to know? I tried --print-exception-stacktrace
but did not see anything in there that would lead me to the problem BUILD file. Any ideas?hundreds-father-404
05/13/2021, 4:37 PMI know i can fix this with constraints.txtI fear constraints.txt support wasn't added yet in 1.30 😕 Very likely, this issue is because of pip's old resolver which uses First One Seen Wins. Click 8 is likely coming from a transitive dependency, rather than a direct dependency Are you using v1 or v2 engine?
salmon-barista-63163
05/13/2021, 4:47 PMsalmon-barista-63163
05/13/2021, 4:48 PMhundreds-father-404
05/13/2021, 4:58 PMpipdeptree
to see where it's coming from. You could use this script I think to create the venv https://www.pantsbuild.org/docs/python-third-party-dependencies#tip-set-up-a-virtual-environment-optional
(altho that might fail with the same command..you could upgrade pip in that script and tell it to use the new resolver perhaps?)hundreds-father-404
05/13/2021, 7:26 PMclick<8
as a direct dep in your project, then set your problematic direct deps to depend on it: https://pantsbuild.slack.com/archives/C046T6T9U/p1620893638017200hundreds-father-404
05/13/2021, 7:27 PMI think pip will do that right thingI think this is the case because iirc Pip's first-seen-wins will at least respect top-level requirements. If you say
pip install click<8 some_req
, it will enforce the click<8
even if some_req
floatssalmon-barista-63163
05/13/2021, 7:28 PMhundreds-father-404
05/13/2021, 7:31 PMsalmon-barista-63163
05/13/2021, 8:18 PMhundreds-father-404
05/13/2021, 8:19 PM