https://pantsbuild.org/ logo
#general
Title
# general
a

ancient-france-42909

05/04/2023, 3:44 PM
Is there a sensible way to change the constraints for pants? Currently, it will pull
requests
2.30
(even though it's yanked, but I guess there'll be a fix out soon) which pulls
urllib3
2.0.2
, which isn't compatible with
botocore
. We can probably play whackamole with
GLOBAL.plugins
, but we also need to run pants on older machines (with an
openssl
older than
1.1.1
, which `urllib3 requires), and then it'd fail to install pants, before resolving the plugins.
b

bitter-ability-32190

05/04/2023, 3:45 PM
Doesn't answer your question in any way, but you might consider using
botocore-a-la-carte
for smaller installation foorprint: https://pypi.org/project/botocore-a-la-carte/
a

ancient-france-42909

05/04/2023, 3:54 PM
Interesting, but, my main problem is we need to run this on Amazon Linux 2, so I'm more interested in stopping
urllib3
from going to
2.x
, the boto stuff we can work around
b

bitter-ability-32190

05/04/2023, 3:56 PM
yeah, again doesn't answer your question, but I hod to plug it
a

ancient-france-42909

05/04/2023, 4:00 PM
I forgot to mention, we're using the 'legacy' script for bootstrapping pants, not sure what the new one does. Let me see
I think I'm wrong, there's no way to actually fixing it in
GLOBAL.plugins
😞
Copy code
19:11:21.81 [INFO] Starting: Resolving plugins: boto3==1.24.59, urllib3==1.26.15
[...]
ERROR: Could not find a version that satisfies the requirement urllib3==1.26.15
ERROR: No matching distribution found for urllib3==1.26.15
b

bitter-ability-32190

05/04/2023, 4:12 PM
...What are we even using requests for?!
a

ancient-france-42909

05/04/2023, 4:13 PM
Collecting requests (from humbug==0.2.7->pantsbuild.pants==2.15.0)
b

bitter-ability-32190

05/04/2023, 4:13 PM
humbug
😐 Oh for anonymous telemetry? LAME
We've talked about removing that. CC @happy-kitchen-89482 @witty-crayon-22786 we could reduce the Pants environment footprint by removing
humbug
, which removes
requests
(and other deps)
b

busy-vase-39202

05/04/2023, 4:14 PM
Anonymous telemetry is optional. If it's in your way, feel free to turn it off. We appreciate the generosity, but as a community our goal is to support your productivity.
a

ancient-france-42909

05/04/2023, 4:15 PM
I think we do have it off 🙂
b

bitter-ability-32190

05/04/2023, 4:15 PM
In this case, turning it off won't help in any way, since it's a hard requirement for Pants itself. It's a bit of a chicken-and-egg 😕
b

busy-vase-39202

05/04/2023, 4:15 PM
:⁠-⁠(
😢 1
a

ancient-france-42909

05/04/2023, 4:16 PM
So, I see that when it tries to install plugins it does a pip freeze and then puts them in
constraints.txt
, which in my case contain
urllib3==2.0.2
, so when I tell it to install an older one, it conflicts with that.
Which doesn't feel like the right thing, btw, since those aren't constraints, those are just what happens to be installed right now
w

witty-crayon-22786

05/04/2023, 4:33 PM
do you have a Pants plugin which is using
urllib3
?
a

ancient-france-42909

05/04/2023, 4:33 PM
Yeah. We have one that's using
boto3
.
w

witty-crayon-22786

05/04/2023, 4:33 PM
ah, sorry. missed that part.
a

ancient-france-42909

05/04/2023, 4:33 PM
I tried to put boto3 in the extra requirements of the plugin, but that didn't seem to work (and, well, I had to move the import somewhere in a function)
I get that, but it's a bit unreasonable to not have a way to override that, especially since requests 2.30 is broken (why pip still installs is it is another question).
Also, it seems that requests 2.30 is compatible with older urllib3s
So it's not unreasonable to put pin urllib3 to
<2
, which wouldn't break new requests, but it also won't break existing code
Okay, so, botocore will move to 2.x soon, until then I just hacked our shell script to force install urllib 1.x
2 Views