PEP 829: Structured Startup Configuration via .site.toml Files

This PEP proposes a TOML-based configuration file format to replace the .pth file mechanism used by site.py during interpreter startup. The new format, using files named .site.toml, provides structured configuration for extending sys.path and executing package initialization code, replacing the current ad-hoc .pth format that conflates path configuration with arbitrary code execution.

#python

PEP 829 – Package Startup Configuration Files | peps.python.org

This PEP changes the way packages influence Python’s startup process. Previously controlled through legacy .pth files parsed and executed by the site.py file during interpreter startup, such files are used to extend sys.path and execute package initiali...

Python Enhancement Proposals (PEPs)