kopia lustrzana https://github.com/jupyterhub/repo2docker
Merge pull request #796 from nuest/dataverse-docs
[MRG] Add docs for Figshare and Dataverse; update Dataverse installations file formattingpull/802/head
commit
27eeef2c97
|
@ -11,6 +11,7 @@ Release date: TBD
|
||||||
New features
|
New features
|
||||||
------------
|
------------
|
||||||
- Add support for Figshare in :pr:`788` by :user:`nuest`.
|
- Add support for Figshare in :pr:`788` by :user:`nuest`.
|
||||||
|
- Add support for Dataverse in :pr:`739` by :user:`Xarthisius`.
|
||||||
|
|
||||||
API changes
|
API changes
|
||||||
-----------
|
-----------
|
||||||
|
|
|
@ -82,4 +82,4 @@ The "Later" items are things that are at the back of the project's mind. At this
|
||||||
time there is no active plan for an item. The project would like to find the
|
time there is no active plan for an item. The project would like to find the
|
||||||
resources and time to discuss and then execute these ideas.
|
resources and time to discuss and then execute these ideas.
|
||||||
* support execution on a remote host (with more resources than available locally) via the command-line
|
* support execution on a remote host (with more resources than available locally) via the command-line
|
||||||
* add support for using ZIP files as the repo (`repo2docker https://example.com/an-archive.zip`) this will give us access to several archives (like Zenodo) that expose things as ZIP files.
|
* add support for using ZIP files as the repo (`repo2docker https://example.com/an-archive.zip`)
|
||||||
|
|
|
@ -5,7 +5,7 @@ jupyter-repo2docker
|
||||||
images from source code repositories**.
|
images from source code repositories**.
|
||||||
|
|
||||||
``repo2docker`` fetches a repository
|
``repo2docker`` fetches a repository
|
||||||
(from GitHub, GitLab, Zenodo, a Git repository or a local directory)
|
(from GitHub, GitLab, Zenodo, Figshare, Dataverse installations, a Git repository or a local directory)
|
||||||
and builds a container image in which the code can be executed.
|
and builds a container image in which the code can be executed.
|
||||||
The image build process is based on the configuration files found in the repository.
|
The image build process is based on the configuration files found in the repository.
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,11 @@ Using ``repo2docker``
|
||||||
|
|
||||||
``repo2docker`` can build a reproducible computational environment for any repository that
|
``repo2docker`` can build a reproducible computational environment for any repository that
|
||||||
follows :ref:`specification`. repo2docker is called with the URL of a Git repository,
|
follows :ref:`specification`. repo2docker is called with the URL of a Git repository,
|
||||||
a DOI from Zenodo or Figshare, or a path to a local directory. It then
|
a `DOI <https://en.wikipedia.org/wiki/Digital_object_identifier>`_ from Zenodo or Figshare,
|
||||||
performs these steps:
|
a `Handle <https://en.wikipedia.org/wiki/Handle_System>`_ or DOI from a Dataverse installation,
|
||||||
|
or a path to a local directory.
|
||||||
|
|
||||||
|
It then performs these steps:
|
||||||
|
|
||||||
1. Inspects the repository for :ref:`configuration files <config-files>`. These will be used to build
|
1. Inspects the repository for :ref:`configuration files <config-files>`. These will be used to build
|
||||||
the environment needed to run the repository.
|
the environment needed to run the repository.
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -10,7 +10,14 @@ from ..utils import copytree, deep_get
|
||||||
|
|
||||||
|
|
||||||
class Dataverse(DoiProvider):
|
class Dataverse(DoiProvider):
|
||||||
"""Provide contents of a Dataverse dataset."""
|
"""
|
||||||
|
Provide contents of a Dataverse dataset.
|
||||||
|
|
||||||
|
This class loads a a list of existing Dataverse installations from the internal
|
||||||
|
file dataverse.json. This file is manually updated with the following command:
|
||||||
|
|
||||||
|
python setup.py generate_dataverse_file
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
data_file = os.path.join(os.path.dirname(__file__), "dataverse.json")
|
data_file = os.path.join(os.path.dirname(__file__), "dataverse.json")
|
||||||
|
|
9
setup.py
9
setup.py
|
@ -31,8 +31,13 @@ class GenerateDataverseInstallationsFileCommand(Command):
|
||||||
data = json.loads(resp_body.decode("utf-8"))
|
data = json.loads(resp_body.decode("utf-8"))
|
||||||
if "installations" not in data:
|
if "installations" not in data:
|
||||||
raise ValueError("Malformed installation map.")
|
raise ValueError("Malformed installation map.")
|
||||||
with open("repo2docker/contentproviders/dataverse.json", "wb") as fp:
|
|
||||||
fp.write(resp_body)
|
def get_identifier(json):
|
||||||
|
return int(json["id"])
|
||||||
|
|
||||||
|
data["installations"].sort(key=get_identifier)
|
||||||
|
with open("repo2docker/contentproviders/dataverse.json", "w") as fp:
|
||||||
|
json.dump(data, fp, indent=4, sort_keys=True)
|
||||||
|
|
||||||
|
|
||||||
__cmdclass = versioneer.get_cmdclass()
|
__cmdclass = versioneer.get_cmdclass()
|
||||||
|
|
Ładowanie…
Reference in New Issue