diff --git a/platformio/package/manifest/model.py b/platformio/package/manifest/model.py index 27684eb1..f881a370 100644 --- a/platformio/package/manifest/model.py +++ b/platformio/package/manifest/model.py @@ -56,7 +56,7 @@ class ManifestModel(DataModel): ) description = DataField(max_length=1000, required=True) keywords = DataField( - type=ListOfType(DataField(max_length=255, regex=r"^[a-z\d\- ]+$")), + type=ListOfType(DataField(max_length=255, regex=r"^[a-z\d\-\+\. ]+$")), required=True, ) authors = DataField(type=ListOfType(AuthorModel), required=True) diff --git a/platformio/package/manifest/parser.py b/platformio/package/manifest/parser.py index 799e1a58..4e6399f3 100644 --- a/platformio/package/manifest/parser.py +++ b/platformio/package/manifest/parser.py @@ -149,7 +149,7 @@ class BaseManifestParser(object): or not isinstance(examples, list) or not all(isinstance(v, dict) for v in examples) ): - data["examples"] = None + examples = None if not examples and self.package_dir: data["examples"] = self.parse_examples_from_dir(self.package_dir) if "examples" in data and not data["examples"]: diff --git a/tests/test_pkgmanifest.py b/tests/test_pkgmanifest.py index 0b2fa58d..e8b827d6 100644 --- a/tests/test_pkgmanifest.py +++ b/tests/test_pkgmanifest.py @@ -427,7 +427,9 @@ def test_package_json_model(): def test_examples_from_dir(tmpdir_factory): package_dir = tmpdir_factory.mktemp("project") - package_dir.join("library.json").write('{"name": "pkg", "version": "1.0.0"}') + package_dir.join("library.json").write( + '{"name": "pkg", "version": "1.0.0", "examples": ["examples/*/*.pde"]}' + ) examples_dir = package_dir.mkdir("examples") # PlatformIO project #1