Skip to content

Commit

Permalink
Changed schema to support url in multi dependencies (#2035)
Browse files Browse the repository at this point in the history
  • Loading branch information
László Velinszky authored Feb 21, 2020
1 parent 04a1544 commit 44c60c4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions poetry/json/schemas/poetry-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@
},
{
"$ref": "#/definitions/path-dependency"
},
{
"$ref": "#/definitions/url-dependency"
}
]
}
Expand Down
23 changes: 23 additions & 0 deletions tests/json/test_poetry_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,31 @@ def base_object():
}


@pytest.fixture
def multi_url_object():
return {
"name": "myapp",
"version": "1.0.0",
"description": "Some description.",
"dependencies": {
"python": [
{
"url": "https://download.pytorch.org/whl/cpu/torch-1.4.0%2Bcpu-cp37-cp37m-linux_x86_64.whl",
"platform": "linux",
},
{"path": "../foo", "platform": "darwin"},
]
},
"dev-dependencies": {},
}


def test_path_dependencies(base_object):
base_object["dependencies"].update({"foo": {"path": "../foo"}})
base_object["dev-dependencies"].update({"foo": {"path": "../foo"}})

assert len(validate_object(base_object, "poetry-schema")) == 0


def test_multi_url_dependencies(multi_url_object):
assert len(validate_object(multi_url_object, "poetry-schema")) == 0

0 comments on commit 44c60c4

Please sign in to comment.