MCPcopy Create free account
hub / github.com/aws/aws-cli / remove_dist_info_directories

Function remove_dist_info_directories

scripts/utils.py:104–113  ·  view source on GitHub ↗

Remove .dist-info directories except for specified packages. Generally these are not needed in the final CLI executable, unless specified via keep_packages.

(dirname, keep_packages)

Source from the content-addressed store, hash-verified

102
103
104def remove_dist_info_directories(dirname, keep_packages):
105 """Remove .dist-info directories except for specified packages.
106 Generally these are not needed in the final CLI executable,
107 unless specified via keep_packages.
108 """
109 for item in os.listdir(dirname):
110 if item.endswith('.dist-info') and not any(
111 package in item for package in keep_packages
112 ):
113 shutil.rmtree(os.path.join(dirname, item))

Callers

nothing calls this directly

Calls 1

rmtreeMethod · 0.45

Tested by

no test coverage detected