Description
zappa --package bundles site-packages from the virtualenv. But, on some distributions, pip installs stuff into dist-packages. So, there is a problem that these platforms (e.g. AMI linux) that they don't include pip-installed packages when they zappa --package
Context
Do zappa --package on with an AMI linux box, or some other platform that does strange things to pip, so it installs stuff into dist-packages.
Expected Behavior
I would like to see all the stuff from dist-packages in the zappa package, so my thing works the same even if I build it on Amazon Linux.
Actual Behavior
The site-packages is included in the zappa package. The dist-packages are not. The stuff I installed with pip in my virtualenv is not included in the zappa package if I ran it on a wacky OS, and my thing doesn't work because it's requirements are not met.
Possible Fix
- update create_handler_venv in zappa/core.py so it does stuff with dist-packages for the relevant platforms
- update detect_flask_apps and detect_django_settings in zappa/utilities.py so they check dist-packages too
- Is this maybe related to why /tests/tests.py#L70 is commented out?
Steps to Reproduce
- Make yourself at home in an AWS Linux AMI
- Create a virtualenv and activate it.
pip installa bunch of stuff, such as the requirements for you app- See for yourself how there is a bunch of stuff installed in dist-packages
- do
zappa --package - compare the size of the lambda.zip with one made on non-debian distribution (it's smaller, because it doesn't include the packages from your virtualenv)
- see how the thing fails with unmet dependencies if you deploy it
- see how the lambda.zip does not contain your requirements
Your Environment
- Zappa version used: latest
- Operating System and Python version: Amazon Linux AMI
- The output of
pip freeze: any - Link to your project (optional): N/A
- Your
zappa_settings.py: N/A (I think)