Context
I haven't deployed or built my zappa project in a while and now that I tried to deploy it yesterday the package size was three times larger than before (before: 33MB, and now 91MB), even though I had not made any changes to the project. I am deploying the project with bitbucket pipelines. The only change was that previously I was using virtualenv<=20.7.2 and now I used 20.10.0 so if I change the pipeline's virtualenv install to
pip install virtualenv==20.7.2 everything works correctly again.
I am thinking that it may be because zappa includes .virtualenv folder, since the package contains packages such as panda and numpy which are not in my requirements file.
using image: python:3.7.3
My pipeline looks the following:
pipelines:
custom:
dev:
- step:
deployment: Dev
caches:
- pip
script:
- pip install virtualenv
- virtualenv --python=python3 env
- source env/bin/activate
- pip install -r requirements.txt
- zappa update dev
Expected Behavior
Serverless package should be a lot smaller and not contain packages from .virtualenv/
Actual Behavior
Serverless package inlcudes packages that are not in requirements file such as panda and numpy. (Maybe because of virtualenv is included?). Did not happen when using virtualenv==20.7.2 but happens in 20.10.0
Possible Fix
Your Environment
- Zappa version used:-0.52.0 but happens also in 0.54.1
- Operating System and Python version: image: python:3.7.3 in bitbucket pipelines
- Your
zappa_settings.json:
{
"dev": {
"aws_region": "us-east-1",
"django_settings": "project.settings",
"profile_name": "default",
"project_name": "<name>",
"runtime": "python3.7",
"s3_bucket": "<bucket>",
"timeout_seconds": 360,
"api_key_required": true,
"api_key": "<api key>",
"cors": true,
"events": [
{
"function": "<function>",
"expression": "rate(1 hour)"
}
]
}
Context
I haven't deployed or built my zappa project in a while and now that I tried to deploy it yesterday the package size was three times larger than before (before: 33MB, and now 91MB), even though I had not made any changes to the project. I am deploying the project with bitbucket pipelines. The only change was that previously I was using virtualenv<=20.7.2 and now I used 20.10.0 so if I change the pipeline's virtualenv install to
pip install virtualenv==20.7.2everything works correctly again.I am thinking that it may be because zappa includes .virtualenv folder, since the package contains packages such as panda and numpy which are not in my requirements file.
using image: python:3.7.3
My pipeline looks the following:
Expected Behavior
Serverless package should be a lot smaller and not contain packages from .virtualenv/
Actual Behavior
Serverless package inlcudes packages that are not in requirements file such as panda and numpy. (Maybe because of virtualenv is included?). Did not happen when using virtualenv==20.7.2 but happens in 20.10.0
Possible Fix
Your Environment
zappa_settings.json:{ "dev": { "aws_region": "us-east-1", "django_settings": "project.settings", "profile_name": "default", "project_name": "<name>", "runtime": "python3.7", "s3_bucket": "<bucket>", "timeout_seconds": 360, "api_key_required": true, "api_key": "<api key>", "cors": true, "events": [ { "function": "<function>", "expression": "rate(1 hour)" } ] }