Browse Source
bpo-33499: Add PYTHONPYCACHEPREFIX env var for alt bytecode cache location. (GH-6834)
bpo-33499: Add PYTHONPYCACHEPREFIX env var for alt bytecode cache location. (GH-6834)
In some development setups it is inconvenient or impossible to write bytecode caches to the code tree, but the bytecode caches are still useful. The PYTHONPYCACHEPREFIX environment variable allows specifying an alternate location for cached bytecode files, within which a directory tree mirroring the code tree will be created. This cache tree is then used (for both reading and writing) instead of the local `__pycache__` subdirectory within each source directory. Exposed at runtime as sys.pycache_prefix (defaulting to None), and can be set from the CLI as "-X pycache_prefix=path". Patch by Carl Meyer.pull/7755/head
committed by
Nick Coghlan
12 changed files with 1385 additions and 1086 deletions
-
5Doc/library/compileall.rst
-
20Doc/library/sys.rst
-
16Doc/using/cmdline.rst
-
3Include/pystate.h
-
62Lib/importlib/_bootstrap_external.py
-
26Lib/test/test_cmd_line.py
-
95Lib/test/test_importlib/test_util.py
-
11Lib/test/test_importlib/util.py
-
3Misc/NEWS.d/next/Core and Builtins/2018-05-15-10-48-47.bpo-33499.uBEc06.rst
-
51Modules/main.c
-
2173Python/importlib_external.h
-
6Python/sysmodule.c
@ -0,0 +1,3 @@ |
|||
Add :envvar:`PYTHONPYCACHEPREFIX` environment variable and :option:`-X` |
|||
``pycache_prefix`` command-line option to set an alternate root directory for |
|||
writing module bytecode cache files. |
|||
2173
Python/importlib_external.h
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue