It appears to be common sense that pre-compiling python files into byte code does not have any non-obvious disadvantages[1].
During my effort of porting pyramid and its dependencies to OpenWrt I also pre-compiled all python packages into byte-code, as the final to-be-flashed OpenWrt images are focused on size and memory footprint.
I however had to realise, that pyramid "just doesn't work" - without throwing any error, exception or alike - only returning 404 for every HTTP request.
Turns out, pyramid uses venusian to scan for its views (and potentially other components), where venusian skips all non-.py files - including .pyc/*.pyo files. Hence, no views in my case.
This is documented here[2].
WARNING: This PR is untested, as in, I only added text without (re-)rendering the docs.
It appears to be common sense that pre-compiling python files into byte code does not have any non-obvious disadvantages[1]. During my effort of porting pyramid and its dependencies to OpenWrt I also pre-compiled all python packages into byte-code, as the final to-be-flashed OpenWrt images are focused on size and memory footprint. I however had to realise, that pyramid "just doesn't work" - without throwing any error, exception or alike - only returning 404 for every HTTP request. Turns out, pyramid uses venusian to scan for its views (and potentially other components), where venusian skips all non-.py files - including .pyc/*.pyo files. Hence, no views in my case. This is documented here[2].
WARNING: This PR is untested, as in, I only added text without (re-)rendering the docs.
[1]https://stackoverflow.com/questions/35618159/should-i-generate-pyc-files-when-deploying/35619259 [2]https://docs.pylonsproject.org/projects/venusian/en/latest/#using-venusian