MCPcopy
hub / github.com/pex-tool/pex / extract_code

Method extract_code

pex/layout.py:649–662  ·  view source on GitHub ↗
(self, dest_dir)

Source from the content-addressed store, hash-verified

647 return os.path.join(self._path, *dist_relpath_components)
648
649 def extract_code(self, dest_dir):
650 # type: (str) -> None
651 for root, dirs, files in os.walk(self._path):
652 rel_root = os.path.relpath(root, self._path)
653 if root == self._path:
654 dirs[:] = [d for d in dirs if d not in ("__pex__", DEPS_DIR, BOOTSTRAP_DIR)]
655 files[:] = [f for f in files if f not in ("__main__.py", "pex", PEX_INFO_PATH)]
656 for d in dirs:
657 safe_mkdir(os.path.join(dest_dir, rel_root, d))
658 for f in files:
659 safe_copy(
660 os.path.join(root, f),
661 os.path.join(dest_dir, rel_root, f),
662 )
663
664 def extract_pex_info(self, dest_dir):
665 # type: (str) -> None

Callers

nothing calls this directly

Calls 3

safe_mkdirFunction · 0.90
safe_copyFunction · 0.90
joinMethod · 0.45

Tested by

no test coverage detected