diff --git a/.readthedocs.yml b/.readthedocs.yml index 5a302fa1..91f1c27f 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -2,8 +2,5 @@ version: 2 -sphinx: - configuration: docs/conf.py - formats: - pdf diff --git a/platformio/package/manifest/model.py b/platformio/package/manifest/model.py index 7fdb66e5..47595bc5 100644 --- a/platformio/package/manifest/model.py +++ b/platformio/package/manifest/model.py @@ -42,7 +42,7 @@ class ExportModel(DataModel): class ExampleModel(DataModel): - name = DataField(max_length=100, regex=r"^[a-zA-Z\d\-\_ ]+$", required=True) + name = DataField(max_length=100, regex=r"^[a-zA-Z\d\-\_/ ]+$", required=True) base = DataField(required=True) files = DataField(type=ListOfType(DataField())) diff --git a/platformio/package/manifest/parser.py b/platformio/package/manifest/parser.py index 46895ecd..ad364963 100644 --- a/platformio/package/manifest/parser.py +++ b/platformio/package/manifest/parser.py @@ -180,6 +180,11 @@ class BaseManifestParser(object): result = {} last_pio_project = None for root, _, files in os.walk(examples_dir): + # skip hidden files and folders + files = [f for f in files if not f.startswith(".")] + if os.path.basename(root).startswith(".") or not files: + continue + if is_platformio_project(root): last_pio_project = root result[last_pio_project] = dict( diff --git a/tests/test_pkgmanifest.py b/tests/test_pkgmanifest.py index 64e6b88e..d5dabb91 100644 --- a/tests/test_pkgmanifest.py +++ b/tests/test_pkgmanifest.py @@ -432,6 +432,7 @@ def test_examples_from_dir(tmpdir_factory): # PlatformIO project #1 pio_dir = examples_dir.mkdir("PlatformIO").mkdir("hello") + pio_dir.join(".vimrc").write("") pio_dir.join("platformio.ini").write("") pio_dir.mkdir("include").join("main.h").write("") pio_dir.mkdir("src").join("main.cpp").write("") @@ -470,6 +471,7 @@ def test_examples_from_dir(tmpdir_factory): data["examples"] = _sort_examples(data["examples"]) model = ManifestModel(**data) + assert model.examples[0].name == "PlatformIO/hello" assert model == ManifestModel( **{ "version": "1.0.0",