Skip to content

Commit

Permalink
Merge pull request #299 from datalad/fix-dv-meta
Browse files Browse the repository at this point in the history
Ensure use of latest required metadata when creating a dataset on demo.dataverse.org
  • Loading branch information
mih committed Oct 5, 2023
2 parents d793dda + aaed9e2 commit 8c934ad
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
3 changes: 2 additions & 1 deletion datalad_dataverse/tests/test_pydataverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ def check_upload(api, dsid, fcontent, fpath, src_md5):
assert df['checksum']['type'] == 'MD5'
assert df['md5'] == df['checksum']['value'] == src_md5
assert df['persistentId'] == ''
assert df['pidURL'] == ''
# TODO: seemingly discontinued between Dataverse 5.13 and 6.0?
#assert df['pidURL'] == ''
assert df['rootDataFileId'] == -1
assert df['storageIdentifier'].startswith('s3://demo-dataverse')

Expand Down
27 changes: 7 additions & 20 deletions datalad_dataverse/tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import json
import requests

from pyDataverse.models import (
Dataverse,
Expand Down Expand Up @@ -104,26 +105,12 @@ def create_test_dataverse_dataset(api, collection, name):
str
The persistent DOI for the dataset
"""
meta = {
"http://purl.org/dc/terms/title": name,
"http://purl.org/dc/terms/subject":
"Medicine, Health and Life Sciences",
"http://purl.org/dc/terms/creator": {
"https://dataverse.org/schema/citation/authorName": "DataLad",
"https://dataverse.org/schema/citation/authorAffiliation":
"datalad.org"
},
"https://dataverse.org/schema/citation/datasetContact": {
"https://dataverse.org/schema/citation/datasetContactEmail":
"team@datalad.org",
"https://dataverse.org/schema/citation/datasetContactName":
"DataLad"
},
"https://dataverse.org/schema/citation/dsDescription": {
"https://dataverse.org/schema/citation/dsDescriptionValue":
"no description"
}
}
# this url points to the API guide, specifically a minimal json example that
# should work with the current dataverse version deployed on
# demo.dataverse.org
current_meta_example = \
"https://guides.dataverse.org/en/latest/_downloads/fc56af1c414df69fd4721ce3629f0c03/dataset-finch1.json"
meta = json.loads(requests.get(current_meta_example).text)
col = _get_dv_collection(api, collection)
req = _create_dv_dataset(api, col, meta)
req.raise_for_status()
Expand Down
3 changes: 0 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,6 @@
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = True

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down

0 comments on commit 8c934ad

Please sign in to comment.