Skip to content

Commit

Permalink
Change temp folders for easier debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu1 committed May 22, 2016
1 parent 8060140 commit 4438488
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions zappa/zappa.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def create_lambda_zip(self, prefix='lambda_package', handler_file=None,
warnings.warn('The local python version is different than that of AWS lambda (2.7.x).\nMake sure the binaries in your conda environment are compatible with AWS lambda')
if use_precompiled_packages:
warnings.warn('Using conda while use_precompiled_packages is set to true is not recommended: it may lead to overwriting conda packages')

USE_CONDA = conda_env is not None

cwd = os.getcwd()
zip_fname = prefix + '-' + str(int(time.time())) + '.zip'
Expand Down Expand Up @@ -295,7 +295,8 @@ def splitpath(path):
print("Warning! Your project and virtualenv have the same name! You may want to re-create your venv with a new name, or explicitly define a 'project_name', as this may cause errors.")

# First, do the project..
temp_project_path = os.path.join(tempfile.gettempdir(), str(int(time.time())))
temp_zappa_folder = os.path.join(tempfile.gettempdir(), str(int(time.time())))
temp_project_path = os.path.join(temp_zappa_folder, 'project')

if minify:
excludes = ZIP_EXCLUDES + exclude + [split_venv[-1]]
Expand All @@ -305,7 +306,7 @@ def splitpath(path):

# Then, do the site-packages..
# TODO Windows: %VIRTUAL_ENV%\Lib\site-packages
temp_package_path = os.path.join(tempfile.gettempdir(), str(int(time.time() + 1)))
temp_package_path = os.path.join(temp_zappa_folder, 'package')
site_packages = os.path.join(venv, 'lib', 'python2.7', 'site-packages')

if minify:
Expand Down Expand Up @@ -371,8 +372,7 @@ def splitpath(path):
zipf.close()

# Trash the temp directory
shutil.rmtree(temp_project_path)
shutil.rmtree(temp_package_path)
shutil.rmtree(temp_zappa_folder)

# Warn if this is too large for Lambda.
file_stats = os.stat(zip_path)
Expand Down

0 comments on commit 4438488

Please sign in to comment.