Add support for "downloadUrl" in package manifest

This commit is contained in:
Ivan Kravets
2019-12-20 20:20:09 +02:00
parent 135ef8701c
commit f9494c940e
3 changed files with 6 additions and 2 deletions

View File

@ -10,7 +10,7 @@ black:
black --target-version py27 ./tests
test:
py.test --verbose --capture=no --exitfirst -n 3 --dist=loadscope tests --ignore tests/test_examples.py
py.test --verbose --capture=no --exitfirst -n 6 --dist=loadscope tests --ignore tests/test_examples.py
before-commit: isort black lint test

View File

@ -92,8 +92,11 @@ class ManifestSchema(Schema):
homepage = fields.Url(validate=validate.Length(min=1, max=255))
license = fields.Str(validate=validate.Length(min=1, max=255))
repository = fields.Nested(RepositorySchema)
# library.json
export = fields.Nested(ExportSchema)
examples = fields.Nested(ExampleSchema, many=True)
downloadUrl = fields.Url(validate=validate.Length(min=1, max=255))
keywords = StrictListField(
fields.Str(
@ -105,7 +108,6 @@ class ManifestSchema(Schema):
]
)
)
platforms = StrictListField(
fields.Str(
validate=[

View File

@ -202,6 +202,7 @@ def test_library_json_schema():
"name": "Benoit Blanchon",
"url": "https://blog.benoitblanchon.fr"
},
"downloadUrl": "https://example.com/package.tar.gz",
"exclude": [
"fuzzing",
"scripts",
@ -251,6 +252,7 @@ def test_library_json_schema():
"authors": [
{"name": "Benoit Blanchon", "url": "https://blog.benoitblanchon.fr"}
],
"downloadUrl": "https://example.com/package.tar.gz",
"export": {"exclude": ["fuzzing", "scripts", "test", "third-party"]},
"frameworks": ["arduino"],
"platforms": ["*"],