|
29 | 29 | 'powerpc64le-linux': 'manylinux_2_17_ppc64le.manylinux2014_ppc64le.musllinux_1_1_ppc64le',
|
30 | 30 | }
|
31 | 31 |
|
| 32 | +_YELLOW = "\033[93m" |
| 33 | + |
32 | 34 |
|
33 | 35 | class ReproducibleWheelFile(WheelFile):
|
34 | 36 | def writestr(self, zinfo_or_arcname, data, *args, **kwargs):
|
@@ -141,6 +143,10 @@ def write_ziglang_wheel(out_dir, *, version, platform, archive):
|
141 | 143 | ]
|
142 | 144 | license_regex = re.compile('|'.join(f'^{pattern}$' for pattern in license_patterns), re.IGNORECASE)
|
143 | 145 |
|
| 146 | + # These file paths MUST remain in sync with the paths in the official |
| 147 | + # Zig tarballs and with the ones defined below in the metadata. The |
| 148 | + # script will raise an error if any of these files are not found in |
| 149 | + # the archive. |
144 | 150 | required_license_paths = [
|
145 | 151 | 'LICENSE',
|
146 | 152 | 'lib/libc/glibc/LICENSES',
|
@@ -190,14 +196,14 @@ def write_ziglang_wheel(out_dir, *, version, platform, archive):
|
190 | 196 | # 1. Check for missing required licenses paths
|
191 | 197 | missing_licenses = set(required_license_paths) - found_license_files
|
192 | 198 | if missing_licenses:
|
193 |
| - print(f"\033[93mWarning: the following required license files were not found in the Zig archive: {', '.join(sorted(missing_licenses))} " |
194 |
| - "\nThis may indicate a change in Zig's license file structure or an error in the listing of license files and/or paths.\033[0m") |
| 199 | + raise RuntimeError(f"{_YELLOW}The following required license files were not found in the Zig archive: {', '.join(sorted(missing_licenses))} " |
| 200 | + f"\nThis may indicate a change in Zig's license file structure or an error in the listing of license files and/or paths.{_YELLOW}") |
195 | 201 |
|
196 | 202 | # 2. Check for potentially missing license files
|
197 | 203 | extra_licenses = potential_extra_licenses - set(required_license_paths)
|
198 | 204 | if extra_licenses:
|
199 |
| - raise RuntimeError(f"\033[93mFound additional potential license files in the Zig archive but not included in the metadata: {', '.join(sorted(extra_licenses))} " |
200 |
| - "\nPlease consider adding these to the license paths if they should be included.\033[0m") |
| 205 | + raise RuntimeError(f"f{_YELLOW}Found additional potential license files in the Zig archive but not included in the metadata: {', '.join(sorted(extra_licenses))} " |
| 206 | + f"\nPlease consider adding these to the license paths if they should be included.{_YELLOW}") |
201 | 207 |
|
202 | 208 | with open('README.pypi.md') as f:
|
203 | 209 | description = f.read()
|
|
0 commit comments