Fix wheels: Install without top_level.txt
@@ -174,7 +174,13 @@ class TopLevelHandler(BaseHandler):
def handle_install(self, src, dest):
tltxtp = os.path.join(src, self.distinfo_name, "top_level.txt")
files_installed = []
- with open(tltxtp, "r") as fin:
+ if not os.path.exists(tltxtp):
+ files = os.listdir(src)
+ fin = [file_name for file_name in files if file_name != self.distinfo_name]
+ print('No top_level.txt, try to fix this.', fin)
+ else:
+ with open(tltxtp, "r") as f:
+ fin = f.readlines()
for pkg_name in fin:
pure = pkg_name.replace("\r", "").replace("\n", "")
sp = os.path.join(src, pure)
