summon: define yaml file schema

This commit is contained in:
Mr. Outis
2019-12-23 23:45:13 -06:00
parent addc56c232
commit 4ad7cb3961
+21
View File
@@ -2,6 +2,7 @@ import importlib
import os
import sys
from contextlib import contextmanager
from voluptuous import Schema
try:
@@ -16,6 +17,26 @@ from dvc.repo import Repo
from dvc.external_repo import external_repo
summon_schema = Schema(
{
"objects": [
{
"name": str,
"description": str,
"paper": str,
"metrics": dict,
"summon": {
"type": "python",
"call": str,
"args": dict,
"deps": [str]
},
}
],
}
)
def get_url(path, repo=None, rev=None, remote=None):
"""Returns an url of a resource specified by path in repo"""
with _make_repo(repo, rev=rev) as _repo: