45 points · by tobilg · 6y ago · 8 comments
Why do you remove the .pyc files instead of the .py files? Keeping the .pyc bytecode means that it can skip the bytecode compiling when used.
Some bootstrapping code I use from [0] is helpful to remove the uncompiled .py files.
[0]: https://github.com/RemotePixel/cogeo-layer/blob/f04d14ebf99d...
Also does this actually work with the new model of .pyc files in __pycache__ dir?
Also, if there are binary build steps, you may want to consider using an ec2 instance for the build. (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes...)
Really like that it's just a few bash scripts.
I use bash and Python scripts like this in my CI environments to manage my Lambda functions. The integration with AWS is quite useful, and may be a feature you want to consider if you plan to widen the scope of this project.
Thank you!