I'm totally hosed my local development environment...
# general
g
I'm totally hosed my local development environment. I cannot run pants no matter what I do. đź§µ
__run.sh
pants.toml
pants.log.txt
__run.sh-logs-with-pex-verbose-set-to-9.txt
I figured all of this out. For some reason it occurs when Python 3.13 is installed via homebrew. Using mise and setting this fixed it:
Copy code
mise use -g python@3.11
h
Local pythons shouldn’t affect pants’s ability to install and run itself. It embeds its own Python (which for 2.26.x happens to be 3.11 but this is an implementation detail).
Did you try updating the
pants
runner (aka “scie-pants”)?
It will update itself with
SCIE_BOOT=update pants
Oh wait, does “I cannot run pants” mean literally that, or just that it fails on a particular command/input?
g
Fails with a particular command/input.
It still seems strange to me how much the python interpreter on the local system can impact how it all runs. Logically I get some of it, but other parts I'm baffled, i.e. creating the pytest runner pex. I would expect that to succeed with almost any modern python interpreter.
w
What happens if you narrow your interpreter_constraints? Right now, it is python 3.10 to 3.13 - does everything else in that pipeline support 3.13?
g
Even if it was constrained to 3.12 it still failed.
w
Hard to read your logs on mobile, but is 3.12 available on your path? I saw python 3.9 - but not the rest (again, REALLY hard to read on mobile and the search kinda sucks). pytest might have been expecting 3.12
High level, the Pythons you have on your machine can affect how your application code work - but “shouldn’t” change how Pants itself works (with some caveats)
g
Yeah I would hope that’s true. I’ve had to rollback to 2.24 (from 2.26) 2x now. I keep having just a few developers with all sorts of weird issues after upgrading that I haven’t been able to diagnose. I will be hitting it again next week is isolation on their laptops to see if I can figure it out. It’s been really weird since I started using pants since 2.19 and haven’t had a single issue upgrading until now. And we have a lot of stuff in our monorepo.
w
So, in general - some suggestions I would have from debugging I've done for clients: • Ensure everyone is using the same mechanism to launch Pants (e.g. everyone on the latest
scie-pants
- not some people using the script, some launcher, etc) • Narrow your
interpreter_constraints
- if for no other reason than it speeds up lockfile generation, if there are multiple interpreters - I would consider multiple resolves as well • Make sure
generate-lockfiles
works with your given interpreter_constraints • Check for any
interpreter_constraints
overriding deeper in the BUILD hierarchy That's usually a safe way to keep local system changes out of it. While I still haven't used it, I think the pyenv or pbs backends might help out. I need some time to deep dive to see how they work, but in the ideal world, your local system python should be entirely irrelevant in this pipeline