diff --git a/swh/lister/nixguix/lister.py b/swh/lister/nixguix/lister.py --- a/swh/lister/nixguix/lister.py +++ b/swh/lister/nixguix/lister.py @@ -49,18 +49,6 @@ pass -@dataclass -class OriginUpstream: - """Upstream origin (e.g. NixOS/nixpkgs, Guix/Guix).""" - - origin: str - """Canonical url of the repository""" - version: int - """Version of the repository (dismissed?)""" - revision: str - """Revision of the repository (dismissed?)""" - - @dataclass class Artifact: """Metadata information on Remote Artifact with url (tarball or file).""" @@ -91,11 +79,10 @@ """The possible artifact types listed out of the manifest.""" ARTIFACT = "artifact" - ORIGIN = "origin" VCS = "vcs" -PageResult = Tuple[ArtifactType, Union[Artifact, VCS, OriginUpstream]] +PageResult = Tuple[ArtifactType, Union[Artifact, VCS]] VCS_SUPPORTED = ("git", "svn", "hg") @@ -265,13 +252,7 @@ # ... if any raw_data = response.json() - version = raw_data["version"] - revision = raw_data["revision"] - yield ArtifactType.ORIGIN, OriginUpstream( - self.origin_upstream, - version, - revision, - ) + yield ArtifactType.VCS, VCS(origin=self.origin_upstream, type="git") # grep '"type"' guix-sources.json | sort | uniq # "type": false <<<<<<<<< noise @@ -312,8 +293,6 @@ assert urls is not None - # Deal with misplaced origins - # FIXME: T3294: Fix missing scheme in urls origin, *fallback_urls = urls @@ -385,17 +364,6 @@ visit_type=artifact.type, ) - def origin_to_listed_origin( - self, origin_upstream: OriginUpstream - ) -> Iterator[ListedOrigin]: - """Given an upstream origin, yield a ListedOrigin.""" - assert self.lister_obj.id is not None - yield ListedOrigin( - lister_id=self.lister_obj.id, - url=origin_upstream.origin, - visit_type="git", # both nixpkgs and guix are git origins so far - ) - def artifact_to_listed_origin(self, artifact: Artifact) -> Iterator[ListedOrigin]: """Given an artifact (tarball, file), yield one ListedOrigin.""" assert self.lister_obj.id is not None