From f9494c940eb63a505231354efacc17840e4d370f Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Fri, 20 Dec 2019 20:20:09 +0200 Subject: [PATCH] Add support for "downloadUrl" in package manifest --- Makefile | 2 +- platformio/package/manifest/schema.py | 4 +++- tests/test_pkgmanifest.py | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 088bae11..30cfe178 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/platformio/package/manifest/schema.py b/platformio/package/manifest/schema.py index f1d68e08..790f3226 100644 --- a/platformio/package/manifest/schema.py +++ b/platformio/package/manifest/schema.py @@ -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=[ diff --git a/tests/test_pkgmanifest.py b/tests/test_pkgmanifest.py index 18078a7f..72b347c5 100644 --- a/tests/test_pkgmanifest.py +++ b/tests/test_pkgmanifest.py @@ -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": ["*"],