Message316518
We would like to set an environment variable that would cause Python to read and write `__pycache__` directories from a separate location on the filesystem (outside the source code tree). We have two reasons for this:
1. In our development setup (with a webserver running in a container on the dev-tree code), the `__pycache__` directories end up root-owned, and managing permissions on them so that they don't disrupt VCS operations on the code repo is untenable. (Currently we use PYTHONDONTWRITEBYTECODE as a workaround, but we have enough code that this costs us multiple seconds of developer time on every restart; we'd like to take advantage of cached bytecode without requiring that it pollute the code tree.)
2. In addition to just _having_ cached bytecode, we'd like to keep it on a ramdisk to minimize filesystem overhead.
Proposal: a `PYTHON_BYTECODE_PATH` environment variable. If set, `source_from_cache` and `cache_from_source` in `importlib._bootstrap_external` will respect it, creating a directory tree under that prefix that mirrors the source tree. |
|
Date |
User |
Action |
Args |
2018-05-14 15:12:49 | carljm | set | recipients:
+ carljm, brett.cannon, ncoghlan, lukasz.langa, eric.snow |
2018-05-14 15:12:49 | carljm | set | messageid: <1526310769.71.0.682650639539.issue33499@psf.upfronthosting.co.za> |
2018-05-14 15:12:49 | carljm | link | issue33499 messages |
2018-05-14 15:12:49 | carljm | create | |
|