python-build-standalone-python-provider
A subsystem for Pants-provided Python leveraging Python Build Standalone (or PBS) (https://gregoryszorc.com/docs/python-build-standalone/main/).
Enabling this subsystem will switch Pants from trying to find an appropriate Python on your system to using PBS to download the correct Python(s).
The Pythons provided by PBS will be used to run any "user" code (your Python code as well as any Python-based tools you use, like black or pylint). The Pythons are also read-only to ensure they remain hermetic across runs of different tools and code.
The Pythons themselves are stored in your named_caches_dir
: https://www.pantsbuild.org/docs/reference-global#named_caches_dir under python_build_standalone/<version>
. Wiping the relevant version directory (with sudo rm -rf
) will force a re-download of Python.
WARNING: PBS does have some behavior quirks, most notably that it has some hardcoded references to build-time paths (such as constants that are found in the sysconfig
module). These paths may be used when trying to compile some extension modules from source.
For more info, see https://gregoryszorc.com/docs/python-build-standalone/main/quirks.html.
Backend: pants.backend.python.providers.experimental.python_build_standalone
Config section: [python-build-standalone-python-provider]