Does anyone know what python_bootstrap is for, re:...
# development
w
Does anyone know what python_bootstrap is for, re: PBS python? src/python/pants/core/subsystems/python_bootstrap.py Are we downloading from there? I thought we used scie-pants to handle downloads
p
That's to allow people to auto-download a PBS python to run user code (eg to run pytest or pylint or for
pants run
). So, it's separate from the python pants uses. Unless I'm thinking of the wrong thing...
w
class PythonBootstrapSubsystem(Subsystem):
options_scope = "python-bootstrap"
help = help_text(
"""
Options used to locate Python interpreters.
This subsystem controls where and how Pants will locate Python, but beyond that it does
not control which Python interpreter versions are actually used for your code: see the
python
subsystem for that.
"""
)
p
Ah. I actually looked at the code. I was talking about src/python/pants/backend/python/providers/python_build_standalone/
My bad.
w
pants/src/python/pants/core/subsystems/python_bootstrap.py
p
yup. Good question. Does that do anything these days? Or is it only for when pants is running from source (bypassing the scie-pants logic)?
w
Exactly, haven't dug in - this is part of the Python 3.14 update, I was just looking at all the places where we had to do something
My guess was that it was for the non-scie case, but I wasn't sure. Checking if anyone else knew offhand before I start digging
Regardless of what it does, while doing this upgrade, I'm more convinced that our endgame is publishing scies.
h
It's used only to find a Python interpreter on which to run the scripts in src/python/pants/core/util_rules/adhoc_binaries.py
E.g., "GunzipBinary" is implemented by running a little python script that calls the`gzip` module
So this is related to that.
w
That’s it? Was it originally used for more?
h
I think it was never used for more
@bitter-ability-32190 has the most context though
b
Yeah IIRC we maybe had other Python processes as well. Maybe there aren't any left that aren't gunzip?
w
👍 Okay, good to know that the usage may have migrated over time. Just saw that the other day and was very confused
b
It's a bummer we need to shell out to Python to gunzip. Iirc there was no standard binary for that we could rely on
There's probably some Rust implemented one we could just curl though? 🤷‍♂️
w
Im sure there is. Likely 50 that all roughly do the same thing 😆