Skip to content

Commit 82f9e17

Browse files
Merge pull request #1 from farfromunique/feature/exclude-distinfo-folders
Don't archive .dist-info folders
2 parents 0b0dc9c + 3edd8eb commit 82f9e17

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/build_lambda.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
import tempfile
1414
import zipfile
1515

16+
logger = logging.getLogger()
17+
1618
def build(src_dir, output_path, install_dependencies):
1719
with tempfile.TemporaryDirectory() as build_dir:
1820
copy_tree(src_dir, build_dir)
@@ -44,8 +46,13 @@ def make_archive(src_dir, output_path):
4446

4547
with zipfile.ZipFile(output_path, 'w') as archive:
4648
for root, dirs, files in os.walk(src_dir):
49+
4750
for file in files:
48-
if file.endswith('.pyc'):
51+
if file.endswith('.pyc') or '.dist-info' in root:
52+
logger.info('Skipping {r}/{f}'.format(
53+
r=root,
54+
f=file
55+
))
4956
break
5057
metadata = zipfile.ZipInfo(
5158
os.path.join(root, file).replace(src_dir, '').lstrip(os.sep)

0 commit comments

Comments
 (0)