hey folks, anyone had success pre-compiling Python...
# general
b
hey folks, anyone had success pre-compiling Python code to .pyc and removing .py on Python targets ?
h
Hello! No, this has not been an area of exploration yet
b
ok, thanks Eric. we'll figure it out
r
We are indeed doing this when building docker images.
b
yes exactly, but it's not without its challenges (or rather weirdness) if you map source volumes onto it
this is what we do as well but I was fishing for something not involving Docker
it's fine though 🙂
r
Ah ok !
w
I don't think I've tried it, but perhaps look into the
pyoxidizer
subsystem? I think it supports some level of bytecode optimization, so maybe that could be helpful? However, I guess that also assumed you want to pyox the whole target, so 🤷 https://github.com/indygreg/PyOxidizer/issues/269
I'd also be surprised if this can't be done via Pex(es) via some awesome mechanism: https://github.com/pantsbuild/pex/issues/1939