Hey all! Is it known what factors could be making ...
# general
a
Hey all! Is it known what factors could be making
generate-lockfiles
so slow?
w
https://github.com/pantsbuild/pants/issues/21223 There are also some discussions in Slack too
One way I think you can speed them up is to narrow your interpreter-constraints, if possible. A lot of the rest probably requires some upcoming
pip
updates (whenever they get merged), or maybe
uv
can help - but I'm handwaving that since I'm not positive about it
a
Thanks! Is
"CPython==3.11.*"
narrow enough of a constraint?
w
Yeah, that's pretty narrow - I had noticed accidentally I would allow multiple pythons, and that had a bit of a perf impact - but yeah, I narrow it down to just the interpreter version. You can TRY the exact python version, I'd be curious if that has a different lockfile generation for you - I don't recall if the patch version mattered too much
a
Yk what I'll give it a try
Let's ruin the build for my colleagues by fixing my specific patch version
w
😆 Yeah, more of a test to see if it matters. I have notes somewhere in Slack. I don't recall the status of it, but I wanted to investigate python-build-standalone as a default option, so that Pants would also automatically download the version specified in the constraints, in which case, system version doesn't matter anymore. I know we have some work done towards that, and pyenv as well, but I haven't been looking into it recently
a
Hah that would be great
Not seeing any speedup
But I'll keep it this way anyway
w
👍 If there is no speedup - then the opened up * should be fine, I guess it was just when I had multiple python versions
Also, are you on a recent pex/pip?
a
I think so? Pip is on v25 and Pex just came with Pants...
w
👍
d
I’ve also found that specifying exact matches for the requirements themselves (rather than ranges) speeds up resolution, particularly when a solution can’t be found. One of the biggest culprit for us was boto. They release pretty much daily, and in some cases pip was trying all the versions during resolution rather than starting with the latest
a
Ohhhh
That could just be it
All my deps are defined like
==1.*
...
w
I’ve also found that specifying exact matches for the requirements themselves (rather than ranges) speeds up resolution, particularly when a solution can’t be found. One of the biggest culprit for us was boto. They release pretty much daily, and in some cases pip was trying all the versions during resolution rather than starting with the latest
That's a great point - I almost always fully specify, so I don't even think about this