diff --git a/swh/clearlydefined/mapping_utils.py b/swh/clearlydefined/mapping_utils.py --- a/swh/clearlydefined/mapping_utils.py +++ b/swh/clearlydefined/mapping_utils.py @@ -45,14 +45,14 @@ AUTHORITY = MetadataAuthority( type=MetadataAuthorityType.REGISTRY, url="https://clearlydefined.io/", - metadata={}, + metadata=None, ) FETCHER = MetadataFetcher( name="swh-clearlydefined", version="0.0.1", - metadata={}, + metadata=None, ) @@ -73,8 +73,8 @@ type=type, target=parse_swhid(swh_id), discovery_date=date, - authority=attr.evolve(AUTHORITY, metadata=None), - fetcher=attr.evolve(FETCHER, metadata=None), + authority=AUTHORITY, + fetcher=FETCHER, format=format, origin=origin.url if origin else None, metadata=json.dumps(metadata).encode("utf-8"), diff --git a/swh/clearlydefined/tests/test_mapping_utils.py b/swh/clearlydefined/tests/test_mapping_utils.py --- a/swh/clearlydefined/tests/test_mapping_utils.py +++ b/swh/clearlydefined/tests/test_mapping_utils.py @@ -186,8 +186,8 @@ "swh:1:cnt:d81cc0710eb6cf9efd5b920a8453e1e07157b6cd" ), discovery_date=datetime(year=2021, month=2, day=6, tzinfo=timezone.utc), - authority=attr.evolve(AUTHORITY, metadata=None), - fetcher=attr.evolve(FETCHER, metadata=None), + authority=AUTHORITY, + fetcher=FETCHER, format="clearlydefined-definition-json", origin="http://central.maven.org/maven2/za/co/absa/cobrix/cobol-parser/" "0.4.0/cobol-parser-0.4.0-sources.jar", @@ -221,8 +221,8 @@ "swh:1:rev:4c66129b968ab8122964823d1d77677f50884cf6" ), discovery_date=datetime(year=2021, month=2, day=6, tzinfo=timezone.utc), - authority=attr.evolve(AUTHORITY, metadata=None), - fetcher=attr.evolve(FETCHER, metadata=None), + authority=AUTHORITY, + fetcher=FETCHER, format="clearlydefined-definition-json", origin="http://central.maven.org/maven2/za/co/absa/cobrix/cobol-parser/" "0.4.0/cobol-parser-0.4.0-sources.jar", @@ -258,8 +258,8 @@ "swh:1:cnt:d81cc0710eb6cf9efd5b920a8453e1e07157b6cd" ), discovery_date=datetime(year=2021, month=2, day=6, tzinfo=timezone.utc), - authority=attr.evolve(AUTHORITY, metadata=None), - fetcher=attr.evolve(FETCHER, metadata=None), + authority=AUTHORITY, + fetcher=FETCHER, format="clearlydefined-harvest-scancode-json", origin=None, metadata=json.dumps( @@ -294,8 +294,8 @@ "swh:1:cnt:d81cc0710eb6cf9efd5b920a8453e1e07157b6cd" ), discovery_date=datetime(year=2021, month=2, day=6, tzinfo=timezone.utc), - authority=attr.evolve(AUTHORITY, metadata=None), - fetcher=attr.evolve(FETCHER, metadata=None), + authority=AUTHORITY, + fetcher=FETCHER, format="clearlydefined-harvest-scancode-json", origin=None, metadata=json.dumps( @@ -330,8 +330,8 @@ "swh:1:cnt:36fade77193cb6d2bd826161a0979d64c28ab4fa" ), discovery_date=datetime(year=2021, month=2, day=6, tzinfo=timezone.utc), - authority=attr.evolve(AUTHORITY, metadata=None), - fetcher=attr.evolve(FETCHER, metadata=None), + authority=AUTHORITY, + fetcher=FETCHER, format="clearlydefined-harvest-licensee-json", origin=None, metadata=json.dumps( @@ -367,8 +367,8 @@ "swh:1:cnt:36fade77193cb6d2bd826161a0979d64c28ab4fa" ), discovery_date=datetime(year=2021, month=2, day=6, tzinfo=timezone.utc), - authority=attr.evolve(AUTHORITY, metadata=None), - fetcher=attr.evolve(FETCHER, metadata=None), + authority=AUTHORITY, + fetcher=FETCHER, format="clearlydefined-harvest-licensee-json", origin=None, metadata=json.dumps( @@ -404,8 +404,8 @@ "swh:1:cnt:36fade77193cb6d2bd826161a0979d64c28ab4fa" ), discovery_date=datetime(year=2021, month=2, day=6, tzinfo=timezone.utc), - authority=attr.evolve(AUTHORITY, metadata=None), - fetcher=attr.evolve(FETCHER, metadata=None), + authority=AUTHORITY, + fetcher=FETCHER, format="clearlydefined-harvest-clearlydefined-json", origin=None, metadata=json.dumps( @@ -420,8 +420,8 @@ "swh:1:cnt:d81cc0710eb6cf9efd5b920a8453e1e07157b6cd" ), discovery_date=datetime(year=2021, month=2, day=6, tzinfo=timezone.utc), - authority=attr.evolve(AUTHORITY, metadata=None), - fetcher=attr.evolve(FETCHER, metadata=None), + authority=AUTHORITY, + fetcher=FETCHER, format="clearlydefined-harvest-clearlydefined-json", origin=None, metadata=json.dumps( @@ -459,8 +459,8 @@ "swh:1:cnt:36fade77193cb6d2bd826161a0979d64c28ab4fa" ), discovery_date=datetime(year=2021, month=2, day=6, tzinfo=timezone.utc), - authority=attr.evolve(AUTHORITY, metadata=None), - fetcher=attr.evolve(FETCHER, metadata=None), + authority=AUTHORITY, + fetcher=FETCHER, format="clearlydefined-harvest-clearlydefined-json", origin=None, metadata=json.dumps( @@ -475,8 +475,8 @@ "swh:1:cnt:d81cc0710eb6cf9efd5b920a8453e1e07157b6cd" ), discovery_date=datetime(year=2021, month=2, day=6, tzinfo=timezone.utc), - authority=attr.evolve(AUTHORITY, metadata=None), - fetcher=attr.evolve(FETCHER, metadata=None), + authority=AUTHORITY, + fetcher=FETCHER, format="clearlydefined-harvest-clearlydefined-json", origin=None, metadata=json.dumps(