Skip to content

Commit 0f9bb71

Browse files
committed
Skip some bin dirs when calculating the pkg hash
1 parent cfd9619 commit 0f9bb71

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

scripts/lambda-package-zip.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
77
- Libraries and executables are hashed after being stripped of their symbols.
88
This ensures that compiler metadata doesn't needlessly change the hash.
9-
- *.pyc, *.pyi, and *.o files are skipped in the hash.
9+
- *.pyc, *.pyi, *.o files are skipped in the hash.
1010
- Makefile files are skipped in the hash.
1111
- __pycache__ and *.dist-info directories and their contents are skipped in the
1212
hash.
@@ -69,6 +69,11 @@
6969
SKIP_FILE_NAMES = {
7070
'Makefile',
7171
}
72+
SKIP_DIRS = {
73+
'bin',
74+
'python/bin',
75+
'node_modules/.bin',
76+
}
7277

7378
def _tmpdir():
7479
for name in ['TMPDIR', 'TEMP', 'TMP']:
@@ -393,6 +398,11 @@ def get_package_hash(package_path):
393398
continue
394399
if _dir == '__pycache__':
395400
continue
401+
402+
_dir_rel = path.relpath(path.join(root, _dir), package_path)
403+
if _dir_rel in SKIP_DIRS:
404+
continue
405+
396406
_dirs.append(_dir)
397407
dirs[:] = _dirs
398408

0 commit comments

Comments
 (0)