Working to update an AWS Lambda function that relies on Flask / zappa that was originally written by another programmer. If Python modules are not imported / used by the scripts that are running in Lambda, can I remove them without any problem from requirements.txt?
The example file provided by AWS seems to have very few requirements. I just want to make sure that Cloudwatch continues to work and I'm not deleting things that AWS depends on implicitly.
Some of the packages that I am considering removing (since not imported by the Python scripts) include:
durationpypyrsistentplacebopytzpycparsertroposphereboto3
i.e. removing pyarrow and scikit-learn cut the redeploy time down from 3 minutes to 2 minutes. AWS Lambda also uses less RAM over shorter duration to execute.