Skip to content

Commit

Permalink
Merge pull request #1107 from SongYunSeop/master
Browse files Browse the repository at this point in the history
check cached wheel file
  • Loading branch information
Rich Jones authored Sep 18, 2017
2 parents c085759 + 87c26b8 commit d1617cf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion zappa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,7 @@ def get_cached_manylinux_wheel(self, package_name, package_version, disable_prog
wheel_file = '{0!s}-{1!s}-{2!s}'.format(package_name, package_version, self.manylinux_wheel_file_suffix)
wheel_path = os.path.join(cached_wheels_dir, wheel_file)

if not os.path.exists(wheel_path):
if not os.path.exists(wheel_path) or not zipfile.is_zipfile(wheel_path):
# The file is not cached, download it.
wheel_url = self.get_manylinux_wheel_url(package_name, package_version)
if not wheel_url:
Expand All @@ -749,6 +749,9 @@ def get_cached_manylinux_wheel(self, package_name, package_version, disable_prog
print(" - {}=={}: Downloading".format(package_name, package_version))
with open(wheel_path, 'wb') as f:
self.download_url_with_progress(wheel_url, f, disable_progress)

if not zipfile.is_zipfile(wheel_path):
return None
else:
print(" - {}=={}: Using locally cached manylinux wheel".format(package_name, package_version))

Expand Down

0 comments on commit d1617cf

Please sign in to comment.