Zappa is ignoring some files and modules from installed packages
Author: eldos-dlCreated Jan 23, 2018Updated Nov 4, 2023
Labelsenhancementdocumentation
Context
I've noticed that Zappa is ignoring certain files during packaging. I believe this issue is caused as we are trying to exclude packages already builtin to the python lambda environment namely
exclude = [
"boto3",
"dateutil",
"botocore",
"s3transfer",
"six.py",
"jmespath",
"concurrent"
]If any of the other python packages have any of the files or subfolders with the above names those are getting excluded as well. I noticed this as I was getting an ImportError while trying to do this from django.utils import six
Expected Behavior
The above mentioned patterns should only be ignored if they are in the root level virtualenv's site-packages but not as sub-module of some other package.
Actual Behavior
These patterns are being excluded at all levels.
Possible Fix
Copying everything and removing these files in a later step or updating the patterns.
Steps to Reproduce
- Install
django==1.11.6,zappa==0.45.1in virtualenv - Create some zappa configuration without exclude argument
- Ensure that there are no compiled files. (If there are compiled files
from django.utils import sixwill not show an error assix.pycwould be available.) - Run
zappa package env - Inspect the package for file
django/utils/six.py
Environment
- Zappa version used: 0.45.1
- Operating System and Python version: Ubuntu 16.04, Python 2.7.12
Source: Miserlou/Zappa