| 102 | |
| 103 | |
| 104 | def check_metadata(archive: str, metadata: bytes, expected: tuple[list[str], str]) -> None: |
| 105 | header, _, description = metadata.decode().partition("\n\n") |
| 106 | actual_headers, expected_headers = Counter(header.split("\n")), Counter(expected[0]) |
| 107 | for line in (actual_headers - expected_headers).elements(): |
| 108 | problems.append(f"{archive}: its metadata has a line that does not follow from pyproject.toml: {line}") |
| 109 | for line in (expected_headers - actual_headers).elements(): |
| 110 | problems.append(f"{archive}: its metadata lacks this line: {line}") |
| 111 | if description != expected[1]: |
| 112 | problems.append(f"{archive}: its description differs from README.md") |
| 113 | |
| 114 | |
| 115 | def decompress(data: bytes, wbits: int) -> bytes | None: |