This commit does the following:
- Move artifact_identity to BasePackageInfo, which uses a class attribute (and is overriden for ArchivePackageInfo, which needs a custom behavior to override keys). Also moved/improved its test
- Add attributes to *PackageInfo classes, that can be accessed instead of the raw metadata.
- Add a from_metadata class method to all *PackageInfo classes, to parse the raw metadata and build the object from it.
- Pass the PackageInfo object to resolve_revision_from and build_revision instead of untyped dicts.
Suggested reading order:
- first, swh/loader/package/loader.py
- then each loader but debian and archive (they have more extensive changes)
- then archive and debian