Pack all files while building python interpreter zip

GitOrigin-RevId: 37839c1ff6a14387dd44bbf863c3bcc9ee915f4c
This commit is contained in:
Semyon Proshev
2021-08-27 23:51:16 +03:00
committed by intellij-monorepo-bot
parent ed359b4bbd
commit b463233d3c
2 changed files with 4 additions and 4 deletions

View File

@@ -116,6 +116,7 @@ def is_skipped_module(path, f, qname):
def is_module(d, root):
return (os.path.exists(os.path.join(root, d, "__init__.py")) or
os.path.exists(os.path.join(root, d, "__init__.pyc")) or
os.path.exists(os.path.join(root, d, "__init__.pyi")) or
os.path.exists(os.path.join(root, d, "__init__.pyo")) or
is_valid_implicit_namespace_package_name(d))

View File

@@ -130,11 +130,10 @@ def add_to_zip(zip, paths):
for root, files in walk_python_path(path):
for name in files:
if name.endswith('.py') or name.endswith('-nspkg.pth'):
file_path = os.path.join(root, name)
arcpath = os.path.relpath(file_path, path)
file_path = os.path.join(root, name)
arcpath = os.path.relpath(file_path, path)
zip.write(file_path, os.path.join(str(hash(path)), arcpath))
zip.write(file_path, os.path.join(str(hash(path)), arcpath))
except:
import traceback