diff --git a/swh/deposit/cli/client.py b/swh/deposit/cli/client.py --- a/swh/deposit/cli/client.py +++ b/swh/deposit/cli/client.py @@ -120,7 +120,9 @@ sd_content = client.service_document() if "error" in sd_content: raise InputError("Service document retrieval: %s" % (sd_content["error"],)) - collection = sd_content["service"]["workspace"]["collection"]["sword:name"] + collection = sd_content["app:service"]["app:workspace"]["app:collection"][ + "sword:name" + ] return collection diff --git a/swh/deposit/client.py b/swh/deposit/client.py --- a/swh/deposit/client.py +++ b/swh/deposit/client.py @@ -16,10 +16,10 @@ import warnings import requests -import xmltodict from swh.core.config import load_from_envvar from swh.deposit import __version__ as swh_deposit_version +from swh.deposit.utils import parse_xml logger = logging.getLogger(__name__) @@ -90,49 +90,6 @@ pass -def _parse(stream, encoding="utf-8"): - """Given a xml stream, parse the result. - - Args: - stream (bytes/text): The stream to parse - encoding (str): The encoding to use if to decode the bytes - stream - - Returns: - A dict of values corresponding to the parsed xml - - """ - if isinstance(stream, bytes): - stream = stream.decode(encoding) - data = xmltodict.parse(stream, encoding=encoding, process_namespaces=False) - if "entry" in data: - data = data["entry"] - if "sword:error" in data: - data = data["sword:error"] - return dict(data) - - -def _parse_with_filter(stream, encoding="utf-8", keys=[]): - """Given a xml stream, parse the result and filter with keys. - - Args: - stream (bytes/text): The stream to parse - encoding (str): The encoding to use if to decode the bytes - stream - keys ([str]): Keys to filter the parsed result - - Returns: - A dict of values corresponding to the parsed xml filtered by - the keys provided. - - """ - data = _parse(stream, encoding=encoding) - m = {} - for key in keys: - m[key] = data.get(key) - return m - - def handle_deprecated_config(config: Dict) -> Tuple[str, Optional[Tuple[str, str]]]: warnings.warn( '"config" argument is deprecated, please ' @@ -343,9 +300,12 @@ 'detail': Some more detail about the error if any """ - return _parse_with_filter( - xml_content, keys=["summary", "detail", "sword:verboseDescription"] - ) + data = parse_xml(xml_content) + return { + "summary": data["summary"], + "detail": data["detail"], + "sword:verboseDescription": data["sword:verboseDescription"], + } def do_execute(self, method, url, info): """Execute the http query to url using method and info information. @@ -426,7 +386,7 @@ """Parse service document's success response. """ - return _parse(xml_content) + return parse_xml(xml_content) class StatusDepositClient(BaseDepositClient): @@ -457,17 +417,16 @@ """Given an xml content as string, returns a deposit dict. """ - return _parse_with_filter( - xml_content, - keys=[ - "deposit_id", - "deposit_status", - "deposit_status_detail", - "deposit_swh_id", - "deposit_swh_id_context", - "deposit_external_id", - ], - ) + data = parse_xml(xml_content) + keys = [ + "deposit_id", + "deposit_status", + "deposit_status_detail", + "deposit_swh_id", + "deposit_swh_id_context", + "deposit_external_id", + ] + return {key: data.get("swh:" + key) for key in keys} class BaseCreateDepositClient(BaseDepositClient): @@ -481,7 +440,7 @@ auth=auth, config=config, error_msg="Post Deposit failure at %s: %s", - empty_result={"deposit_id": None, "deposit_status": None,}, + empty_result={"swh:deposit_id": None, "swh:deposit_status": None,}, ) def compute_url(self, collection, *args, **kwargs): @@ -494,15 +453,14 @@ """Given an xml content as string, returns a deposit dict. """ - return _parse_with_filter( - xml_content, - keys=[ - "deposit_id", - "deposit_status", - "deposit_status_detail", - "deposit_date", - ], - ) + data = parse_xml(xml_content) + keys = [ + "deposit_id", + "deposit_status", + "deposit_status_detail", + "deposit_date", + ] + return {key: data.get("swh:" + key) for key in keys} def compute_headers(self, info: Dict[str, Any]) -> Dict[str, Any]: return info diff --git a/swh/deposit/tests/api/conftest.py b/swh/deposit/tests/api/conftest.py --- a/swh/deposit/tests/api/conftest.py +++ b/swh/deposit/tests/api/conftest.py @@ -81,7 +81,7 @@ ) response_content = parse_xml(response.content) - deposit_id = int(response_content["deposit_id"]) + deposit_id = int(response_content["swh:deposit_id"]) deposit = Deposit.objects.get(pk=deposit_id) deposit.status = DEPOSIT_STATUS_DEPOSITED deposit.save() diff --git a/swh/deposit/tests/api/test_collection_post_atom.py b/swh/deposit/tests/api/test_collection_post_atom.py --- a/swh/deposit/tests/api/test_collection_post_atom.py +++ b/swh/deposit/tests/api/test_collection_post_atom.py @@ -36,7 +36,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] deposit = Deposit.objects.get(pk=deposit_id) dr = DepositRequest.objects.get(deposit=deposit) @@ -162,7 +162,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] deposit = Deposit.objects.get(pk=deposit_id) assert deposit.collection == deposit_collection @@ -203,7 +203,7 @@ response_content = parse_xml(BytesIO(response.content)) - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] deposit = Deposit.objects.get(pk=deposit_id) assert deposit.collection == deposit_collection @@ -243,7 +243,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] deposit = Deposit.objects.get(pk=deposit_id) assert deposit.collection == deposit_collection @@ -282,7 +282,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id = int(response_content["deposit_id"]) + deposit_id = int(response_content["swh:deposit_id"]) deposit = Deposit.objects.get(pk=deposit_id) assert deposit.collection == deposit_collection @@ -316,7 +316,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id = int(response_content["deposit_id"]) + deposit_id = int(response_content["swh:deposit_id"]) deposit = Deposit.objects.get(pk=deposit_id) assert deposit.collection == deposit_collection diff --git a/swh/deposit/tests/api/test_collection_post_binary.py b/swh/deposit/tests/api/test_collection_post_binary.py --- a/swh/deposit/tests/api/test_collection_post_binary.py +++ b/swh/deposit/tests/api/test_collection_post_binary.py @@ -104,7 +104,7 @@ # then response_content = parse_xml(BytesIO(response.content)) assert response.status_code == status.HTTP_201_CREATED - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] deposit = Deposit.objects.get(pk=deposit_id) assert deposit.status == DEPOSIT_STATUS_DEPOSITED @@ -126,7 +126,7 @@ # deprecated tags assert response_content["deposit_archive"] == sample_archive["name"] - assert int(response_content["deposit_id"]) == deposit.id + assert int(response_content["swh:deposit_id"]) == deposit.id assert response_content["deposit_status"] == deposit.status edit_iri = reverse("edit_iri", args=[deposit_collection.name, deposit.id]) @@ -337,7 +337,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] deposit = Deposit.objects.get(pk=deposit_id) @@ -362,7 +362,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id2 = response_content["deposit_id"] + deposit_id2 = response_content["swh:deposit_id"] deposit2 = Deposit.objects.get(pk=deposit_id2) @@ -402,7 +402,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] deposit = Deposit.objects.get(pk=deposit_id) assert deposit.status == "partial" @@ -493,7 +493,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] deposit = Deposit.objects.get(pk=deposit_id) assert deposit.status == DEPOSIT_STATUS_DEPOSITED diff --git a/swh/deposit/tests/api/test_collection_post_metadata.py b/swh/deposit/tests/api/test_collection_post_metadata.py --- a/swh/deposit/tests/api/test_collection_post_metadata.py +++ b/swh/deposit/tests/api/test_collection_post_metadata.py @@ -137,7 +137,7 @@ response_content = parse_xml(BytesIO(response.content)) # Ensure the deposit is finalized - deposit_id = int(response_content["deposit_id"]) + deposit_id = int(response_content["swh:deposit_id"]) deposit = Deposit.objects.get(pk=deposit_id) assert isinstance(swhid_core, SWHID) assert deposit.swhid == str(swhid_core) @@ -217,7 +217,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) # Ensure the deposit is finalized - deposit_id = int(response_content["deposit_id"]) + deposit_id = int(response_content["swh:deposit_id"]) deposit = Deposit.objects.get(pk=deposit_id) # we got not swhid as input so we cannot have those assert deposit.swhid is None diff --git a/swh/deposit/tests/api/test_collection_post_multipart.py b/swh/deposit/tests/api/test_collection_post_multipart.py --- a/swh/deposit/tests/api/test_collection_post_multipart.py +++ b/swh/deposit/tests/api/test_collection_post_multipart.py @@ -101,7 +101,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] deposit = Deposit.objects.get(pk=deposit_id) assert deposit.status == DEPOSIT_STATUS_DEPOSITED @@ -171,7 +171,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] deposit = Deposit.objects.get(pk=deposit_id) assert deposit.status == DEPOSIT_STATUS_DEPOSITED @@ -241,7 +241,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(BytesIO(response.content)) - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] deposit = Deposit.objects.get(pk=deposit_id) assert deposit.status == "partial" diff --git a/swh/deposit/tests/api/test_deposit_private_check.py b/swh/deposit/tests/api/test_deposit_private_check.py --- a/swh/deposit/tests/api/test_deposit_private_check.py +++ b/swh/deposit/tests/api/test_deposit_private_check.py @@ -202,7 +202,7 @@ response_content = parse_xml(response.content) deposit_status = response_content["swh:deposit_status"] assert deposit_status == DEPOSIT_STATUS_DEPOSITED - deposit_id = int(response_content["deposit_id"]) + deposit_id = int(response_content["swh:deposit_id"]) deposit = Deposit.objects.get(pk=deposit_id) assert DEPOSIT_STATUS_DEPOSITED == deposit.status diff --git a/swh/deposit/tests/api/test_deposit_schedule.py b/swh/deposit/tests/api/test_deposit_schedule.py --- a/swh/deposit/tests/api/test_deposit_schedule.py +++ b/swh/deposit/tests/api/test_deposit_schedule.py @@ -59,7 +59,7 @@ response_content = parse_xml(BytesIO(response.content)) actual_state = response_content["swh:deposit_status"] assert actual_state == DEPOSIT_STATUS_DEPOSITED - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] tasks = swh_scheduler.grab_ready_tasks("check-deposit") assert len(tasks) == 1 diff --git a/swh/deposit/tests/api/test_deposit_status.py b/swh/deposit/tests/api/test_deposit_status.py --- a/swh/deposit/tests/api/test_deposit_status.py +++ b/swh/deposit/tests/api/test_deposit_status.py @@ -31,10 +31,13 @@ assert status_response.status_code == status.HTTP_200_OK r = parse_xml(BytesIO(status_response.content)) - assert int(r["deposit_id"]) == deposit.id - assert r["deposit_status"] == DEPOSIT_STATUS_DEPOSITED - assert r["deposit_status_detail"] == DEPOSIT_STATUS_DETAIL[DEPOSIT_STATUS_DEPOSITED] - assert r["deposit_external_id"] == deposit.external_id + assert int(r["swh:deposit_id"]) == deposit.id + assert r["swh:deposit_status"] == DEPOSIT_STATUS_DEPOSITED + assert ( + r["swh:deposit_status_detail"] + == DEPOSIT_STATUS_DETAIL[DEPOSIT_STATUS_DEPOSITED] + ) + assert r["swh:deposit_external_id"] == deposit.external_id def test_status_unknown_deposit(authenticated_client, deposit_collection): @@ -71,11 +74,11 @@ # then assert status_response.status_code == status.HTTP_200_OK r = parse_xml(BytesIO(status_response.content)) - assert int(r["deposit_id"]) == deposit.id - assert r["deposit_status"] == DEPOSIT_STATUS_REJECTED - assert r["deposit_status_detail"] == "Deposit failed the checks" + assert int(r["swh:deposit_id"]) == deposit.id + assert r["swh:deposit_status"] == DEPOSIT_STATUS_REJECTED + assert r["swh:deposit_status_detail"] == "Deposit failed the checks" if deposit.swhid: - assert r["deposit_swhid"] == deposit.swhid + assert r["swh:deposit_swhid"] == deposit.swhid def test_status_with_http_accept_header_should_not_break( @@ -110,12 +113,13 @@ # then assert status_response.status_code == status.HTTP_200_OK r = parse_xml(BytesIO(status_response.content)) - assert int(r["deposit_id"]) == deposit.id - assert r["deposit_status"] == DEPOSIT_STATUS_LOAD_SUCCESS + assert int(r["swh:deposit_id"]) == deposit.id + assert r["swh:deposit_status"] == DEPOSIT_STATUS_LOAD_SUCCESS assert ( - r["deposit_status_detail"] == DEPOSIT_STATUS_DETAIL[DEPOSIT_STATUS_LOAD_SUCCESS] + r["swh:deposit_status_detail"] + == DEPOSIT_STATUS_DETAIL[DEPOSIT_STATUS_LOAD_SUCCESS] ) assert deposit.swhid is not None - assert r["deposit_swh_id"] == deposit.swhid + assert r["swh:deposit_swh_id"] == deposit.swhid assert deposit.swhid_context is not None - assert r["deposit_swh_id_context"] == deposit.swhid_context + assert r["swh:deposit_swh_id_context"] == deposit.swhid_context diff --git a/swh/deposit/tests/api/test_get_file.py b/swh/deposit/tests/api/test_get_file.py --- a/swh/deposit/tests/api/test_get_file.py +++ b/swh/deposit/tests/api/test_get_file.py @@ -22,9 +22,9 @@ for deposit in [complete_deposit, partial_deposit_only_metadata]: expected_deposit = { - "deposit_id": str(deposit.id), - "deposit_status": deposit.status, - "deposit_status_detail": DEPOSIT_STATUS_DETAIL[deposit.status], + "swh:deposit_id": str(deposit.id), + "swh:deposit_status": deposit.status, + "swh:deposit_status_detail": DEPOSIT_STATUS_DETAIL[deposit.status], } url = reverse(CONT_FILE_IRI, args=[deposit.collection.name, deposit.id]) diff --git a/swh/deposit/tests/cli/test_client.py b/swh/deposit/tests/cli/test_client.py --- a/swh/deposit/tests/cli/test_client.py +++ b/swh/deposit/tests/cli/test_client.py @@ -522,12 +522,17 @@ """ api_url_basename = "deposit.test.status" deposit_id = 1033 - deposit_status_xml_path = os.path.join( - datadir, f"https_{api_url_basename}", f"1_test_{deposit_id}_status" - ) - with open(deposit_status_xml_path, "r") as f: - deposit_status_xml = f.read() - expected_deposit_status = dict(parse_xml(deposit_status_xml)) + expected_deposit_status = { + "deposit_id": str(deposit_id), + "deposit_status": "done", + "deposit_status_detail": ( + "The deposit has been successfully loaded into the " + "Software Heritage archive" + ), + "deposit_swh_id": "swh:1:dir:ef04a768181417fbc5eef4243e2507915f24deea", + "deposit_swh_id_context": "swh:1:dir:ef04a768181417fbc5eef4243e2507915f24deea;origin=https://www.softwareheritage.org/check-deposit-2020-10-08T13:52:34.509655;visit=swh:1:snp:c477c6ef51833127b13a86ece7d75e5b3cc4e93d;anchor=swh:1:rev:f26f3960c175f15f6e24200171d446b86f6f7230;path=/", # noqa + "deposit_external_id": "check-deposit-2020-10-08T13:52:34.509655", + } # fmt: off result = cli_runner.invoke( @@ -562,12 +567,17 @@ """ api_url_basename = "deposit.test.updateswhid" deposit_id = 123 - deposit_status_xml_path = os.path.join( - datadir, f"https_{api_url_basename}", f"1_test_{deposit_id}_status" - ) - with open(deposit_status_xml_path, "r") as f: - deposit_status_xml = f.read() - expected_deposit_status = dict(parse_xml(deposit_status_xml)) + expected_deposit_status = { + "deposit_external_id": "check-deposit-2020-10-08T13:52:34.509655", + "deposit_id": str(deposit_id), + "deposit_status": "done", + "deposit_status_detail": ( + "The deposit has been successfully loaded into the " + "Software Heritage archive" + ), + "deposit_swh_id": "swh:1:dir:ef04a768181417fbc5eef4243e2507915f24deea", + "deposit_swh_id_context": "swh:1:dir:ef04a768181417fbc5eef4243e2507915f24deea;origin=https://www.softwareheritage.org/check-deposit-2020-10-08T13:52:34.509655;visit=swh:1:snp:c477c6ef51833127b13a86ece7d75e5b3cc4e93d;anchor=swh:1:rev:f26f3960c175f15f6e24200171d446b86f6f7230;path=/", # noqa + } assert expected_deposit_status["deposit_status"] == "done" assert expected_deposit_status["deposit_swh_id"] is not None diff --git a/swh/deposit/tests/conftest.py b/swh/deposit/tests/conftest.py --- a/swh/deposit/tests/conftest.py +++ b/swh/deposit/tests/conftest.py @@ -401,7 +401,7 @@ assert response.status_code == status.HTTP_201_CREATED response_content = parse_xml(response.content) - deposit_id = response_content["deposit_id"] + deposit_id = response_content["swh:deposit_id"] from swh.deposit.models import Deposit deposit = Deposit._default_manager.get(pk=deposit_id) diff --git a/swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_status b/swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_status --- a/swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_status +++ b/swh/deposit/tests/data/https_deposit.test.metadata/1_test_666_status @@ -1,6 +1,12 @@ + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:sd="https://www.softwareheritage.org/schema/2018/deposit"> + 666 + partial + Deposit is partially received. To finalize it, In-Progress header should be false + external-id + 666 partial Deposit is partially received. To finalize it, In-Progress header should be false diff --git a/swh/deposit/tests/data/https_deposit.test.status/1_test_1033_status b/swh/deposit/tests/data/https_deposit.test.status/1_test_1033_status --- a/swh/deposit/tests/data/https_deposit.test.status/1_test_1033_status +++ b/swh/deposit/tests/data/https_deposit.test.status/1_test_1033_status @@ -1,6 +1,14 @@ + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:sd="https://www.softwareheritage.org/schema/2018/deposit"> + 1033 + done + The deposit has been successfully loaded into the Software Heritage archive + swh:1:dir:ef04a768181417fbc5eef4243e2507915f24deea + swh:1:dir:ef04a768181417fbc5eef4243e2507915f24deea;origin=https://www.softwareheritage.org/check-deposit-2020-10-08T13:52:34.509655;visit=swh:1:snp:c477c6ef51833127b13a86ece7d75e5b3cc4e93d;anchor=swh:1:rev:f26f3960c175f15f6e24200171d446b86f6f7230;path=/ + check-deposit-2020-10-08T13:52:34.509655 + 1033 done The deposit has been successfully loaded into the Software Heritage archive diff --git a/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_123_metadata b/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_123_metadata --- a/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_123_metadata +++ b/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_123_metadata @@ -1,6 +1,14 @@ + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:sd="https://www.softwareheritage.org/schema/2018/deposit"> + 123 + done + The deposit has been successfully loaded into the Software Heritage archive + swh:1:dir:ef04a768181417fbc5eef4243e2507915f24deea + swh:1:dir:ef04a768181417fbc5eef4243e2507915f24deea;origin=https://www.softwareheritage.org/check-deposit-2020-10-08T13:52:34.509655;visit=swh:1:snp:c477c6ef51833127b13a86ece7d75e5b3cc4e93d;anchor=swh:1:rev:f26f3960c175f15f6e24200171d446b86f6f7230;path=/ + check-deposit-2020-10-08T13:52:34.509655 + 123 done The deposit has been successfully loaded into the Software Heritage archive diff --git a/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_123_status b/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_123_status --- a/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_123_status +++ b/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_123_status @@ -1,6 +1,15 @@ + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:sd="https://www.softwareheritage.org/schema/2018/deposit"> + + 123 + done + The deposit has been successfully loaded into the Software Heritage archive + swh:1:dir:ef04a768181417fbc5eef4243e2507915f24deea + swh:1:dir:ef04a768181417fbc5eef4243e2507915f24deea;origin=https://www.softwareheritage.org/check-deposit-2020-10-08T13:52:34.509655;visit=swh:1:snp:c477c6ef51833127b13a86ece7d75e5b3cc4e93d;anchor=swh:1:rev:f26f3960c175f15f6e24200171d446b86f6f7230;path=/ + check-deposit-2020-10-08T13:52:34.509655 + 123 done The deposit has been successfully loaded into the Software Heritage archive diff --git a/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_321_status b/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_321_status --- a/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_321_status +++ b/swh/deposit/tests/data/https_deposit.test.updateswhid/1_test_321_status @@ -1,6 +1,12 @@ + xmlns:dcterms="http://purl.org/dc/terms/" + xmlns:sd="https://www.softwareheritage.org/schema/2018/deposit"> + 321 + partial + The deposit is in partial state + check-deposit-2020-10-08T13:52:34.509655 + 321 partial The deposit is in partial state diff --git a/swh/deposit/utils.py b/swh/deposit/utils.py --- a/swh/deposit/utils.py +++ b/swh/deposit/utils.py @@ -16,6 +16,7 @@ def parse_xml(stream, encoding="utf-8"): namespaces = { "http://www.w3.org/2005/Atom": None, + "http://www.w3.org/2007/app": "app", "http://purl.org/dc/terms/": None, "https://doi.org/10.5063/SCHEMA/CODEMETA-2.0": "codemeta", "http://purl.org/net/sword/terms/": "sword",