`allowed` gives the committed path of each file's name in the archive
(
archive: str,
members: list[Member],
committed: dict[str, Committed],
allowed: dict[str, str],
required: set[str],
)
| 184 | |
| 185 | |
| 186 | def check_files( |
| 187 | archive: str, |
| 188 | members: list[Member], |
| 189 | committed: dict[str, Committed], |
| 190 | allowed: dict[str, str], |
| 191 | required: set[str], |
| 192 | ) -> dict[str, bytes]: |
| 193 | """`allowed` gives the committed path of each file's name in the archive""" |
| 194 | for name, count in Counter(member.name for member in members).items(): |
| 195 | if count > 1: |
| 196 | problems.append(f"{archive}: {name} is there {count} times") |
| 197 | |
| 198 | for member in members: |
| 199 | if member.name in allowed: |
| 200 | path = allowed[member.name] |
| 201 | if committed[path] != (git_hash(member.data), member.executable): |
| 202 | problems.append(f"{archive}: {member.name} differs from the commit's {path}") |
| 203 | elif member.name not in required: |
| 204 | problems.append(f"{archive}: {member.name} is not in the commit") |
| 205 | |
| 206 | contents = {member.name: member.data for member in members} |
| 207 | problems.extend(f"{archive}: {name} is missing" for name in sorted(required - contents.keys())) |
| 208 | return contents |
| 209 | |
| 210 | |
| 211 | def check_wheel(path: Path, package: str, pyproject: dict[str, Any], committed: dict[str, Committed]) -> bytes: |
no test coverage detected