(path: Path, package: str, committed: dict[str, Committed])
| 234 | |
| 235 | |
| 236 | def check_sdist(path: Path, package: str, committed: dict[str, Committed]) -> bytes: |
| 237 | metadata = f"{package}/PKG-INFO" |
| 238 | allowed = {f"{package}/{name}": name for name in committed} |
| 239 | installed = { |
| 240 | name for name, file in allowed.items() if re.fullmatch(rf"src/.*|pyproject\.toml|README\.md|{LICENSE}", file) |
| 241 | } |
| 242 | return check_files(path.name, read_sdist(path), committed, allowed, {*installed, metadata}).get(metadata, b"") |
| 243 | |
| 244 | |
| 245 | def main() -> None: |
no test coverage detected