Some variants on option 2 to consider:
- allowing
__pysource__
to contain a metadata file that describes how to obtain the source files, or points to a different directory for them (Note: I dropped the trailings
deliberately, as I don’t think it improves the clarify of the name) - supporting a PYTHONPYSOURCEPREFIX option similar to PYTHONPYCACHEPREFIX to allow parallel trees rather than nested directories
Regarding zipping the entire standard library (from the larger brainstorming doc):
$ python3 -m site | grep zip
‘/usr/lib64/python38.zip’,
Compressing the entire stdlib is theoretically supported, so the interpreter includes an entry for it in the default definition of sys.path. Running that way isn’t as well tested as running uncompressed, but it’s expected to work.