MCPcopy Create free account
hub / github.com/apache/burr / _verify_wheel_readable

Function _verify_wheel_readable

scripts/verify_apache_artifacts.py:155–180  ·  view source on GitHub ↗

Verify wheel can be read and contains expected structure.

(wheel_path: str)

Source from the content-addressed store, hash-verified

153
154
155def _verify_wheel_readable(wheel_path: str) -> bool:
156 """Verify wheel can be read and contains expected structure."""
157 print(f" Checking wheel readability: {os.path.basename(wheel_path)}")
158
159 try:
160 with zipfile.ZipFile(wheel_path, "r") as whl:
161 file_list = whl.namelist()
162
163 if len(file_list) == 0:
164 print(" ✗ Wheel is empty (no files)")
165 return False
166
167 # Check for metadata
168 metadata_files = [f for f in file_list if "METADATA" in f or "WHEEL" in f]
169 if not metadata_files:
170 print(" ✗ Wheel missing required metadata files")
171 return False
172
173 print(f" ✓ Wheel is readable and contains {len(file_list)} files")
174 return True
175 except zipfile.BadZipFile:
176 print(" ✗ Wheel is corrupted or not a valid ZIP file")
177 return False
178 except Exception as e:
179 print(f" ✗ Error reading wheel: {e}")
180 return False
181
182
183def _verify_artifact_exists(artifact_path: str, min_size: int = 1000) -> bool:

Callers 1

verify_signaturesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected