Pylons / pyramid

Pyramid - A Python web framework
https://trypyramid.com/
Other
3.97k stars 887 forks source link

Add warning to docs about venusian's limitation of only scanning for *.py files #3589

Closed mirko closed 4 years ago

mirko commented 4 years ago

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

stevepiercy commented 4 years ago

I was in the middle of rewriting this warning when Bert's review came in. Here's a screenshot of the current iteration.

Google Chrome007

stevepiercy commented 4 years ago

Ooops, tox -e docs is more strict than my Sphinx config. Fixing.