fastled 1.1.36__tar.gz → 1.1.37__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. {fastled-1.1.36 → fastled-1.1.37}/PKG-INFO +2 -1
  2. {fastled-1.1.36 → fastled-1.1.37}/README.md +1 -0
  3. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/__init__.py +28 -4
  4. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/project_init.py +1 -1
  5. fastled-1.1.37/src/fastled/test/examples.py +31 -0
  6. {fastled-1.1.36 → fastled-1.1.37}/src/fastled.egg-info/PKG-INFO +2 -1
  7. {fastled-1.1.36 → fastled-1.1.37}/src/fastled.egg-info/SOURCES.txt +1 -0
  8. fastled-1.1.37/tests/test_api.py +24 -0
  9. fastled-1.1.36/src/fastled/test/examples.py +0 -16
  10. {fastled-1.1.36 → fastled-1.1.37}/.aiderignore +0 -0
  11. {fastled-1.1.36 → fastled-1.1.37}/.github/workflows/build_multi_docker_image.yml +0 -0
  12. {fastled-1.1.36 → fastled-1.1.37}/.github/workflows/lint.yml +0 -0
  13. {fastled-1.1.36 → fastled-1.1.37}/.github/workflows/test_macos.yml +0 -0
  14. {fastled-1.1.36 → fastled-1.1.37}/.github/workflows/test_ubuntu.yml +0 -0
  15. {fastled-1.1.36 → fastled-1.1.37}/.github/workflows/test_win.yml +0 -0
  16. {fastled-1.1.36 → fastled-1.1.37}/.gitignore +0 -0
  17. {fastled-1.1.36 → fastled-1.1.37}/.pylintrc +0 -0
  18. {fastled-1.1.36 → fastled-1.1.37}/.vscode/launch.json +0 -0
  19. {fastled-1.1.36 → fastled-1.1.37}/.vscode/settings.json +0 -0
  20. {fastled-1.1.36 → fastled-1.1.37}/.vscode/tasks.json +0 -0
  21. {fastled-1.1.36 → fastled-1.1.37}/LICENSE +0 -0
  22. {fastled-1.1.36 → fastled-1.1.37}/MANIFEST.in +0 -0
  23. {fastled-1.1.36 → fastled-1.1.37}/clean +0 -0
  24. {fastled-1.1.36 → fastled-1.1.37}/docs/fastled.js +0 -0
  25. {fastled-1.1.36 → fastled-1.1.37}/docs/fastled.wasm +0 -0
  26. {fastled-1.1.36 → fastled-1.1.37}/docs/index.css +0 -0
  27. {fastled-1.1.36 → fastled-1.1.37}/docs/index.html +0 -0
  28. {fastled-1.1.36 → fastled-1.1.37}/docs/index.js +0 -0
  29. {fastled-1.1.36 → fastled-1.1.37}/examples/Blink/Blink.ino +0 -0
  30. {fastled-1.1.36 → fastled-1.1.37}/examples/Chromancer/Chromancer.ino +0 -0
  31. {fastled-1.1.36 → fastled-1.1.37}/examples/Chromancer/detail.h +0 -0
  32. {fastled-1.1.36 → fastled-1.1.37}/examples/Chromancer/gary_woos_wled_port/gary_woos_wled_ledmap.h +0 -0
  33. {fastled-1.1.36 → fastled-1.1.37}/examples/Chromancer/gary_woos_wled_port/presets.json +0 -0
  34. {fastled-1.1.36 → fastled-1.1.37}/examples/Chromancer/gary_woos_wled_port/presets.min.json +0 -0
  35. {fastled-1.1.36 → fastled-1.1.37}/examples/Chromancer/gen.py +0 -0
  36. {fastled-1.1.36 → fastled-1.1.37}/examples/Chromancer/mapping.h +0 -0
  37. {fastled-1.1.36 → fastled-1.1.37}/examples/Chromancer/net.h +0 -0
  38. {fastled-1.1.36 → fastled-1.1.37}/examples/Chromancer/output.json +0 -0
  39. {fastled-1.1.36 → fastled-1.1.37}/examples/Chromancer/ripple.h +0 -0
  40. {fastled-1.1.36 → fastled-1.1.37}/examples/Chromancer/screenmap.json.h +0 -0
  41. {fastled-1.1.36 → fastled-1.1.37}/examples/ColorPalette/ColorPalette.ino +0 -0
  42. {fastled-1.1.36 → fastled-1.1.37}/examples/ColorTemperature/ColorTemperature.ino +0 -0
  43. {fastled-1.1.36 → fastled-1.1.37}/examples/Cylon/Cylon.ino +0 -0
  44. {fastled-1.1.36 → fastled-1.1.37}/examples/DemoReel100/DemoReel100.ino +0 -0
  45. {fastled-1.1.36 → fastled-1.1.37}/examples/Esp32Rmt51/Esp32Rmt51.ino +0 -0
  46. {fastled-1.1.36 → fastled-1.1.37}/examples/EspI2SDemo/EspI2SDemo.ino +0 -0
  47. {fastled-1.1.36 → fastled-1.1.37}/examples/Fire2012/Fire2012.ino +0 -0
  48. {fastled-1.1.36 → fastled-1.1.37}/examples/Fire2012WithPalette/Fire2012WithPalette.ino +0 -0
  49. {fastled-1.1.36 → fastled-1.1.37}/examples/FirstLight/FirstLight.ino +0 -0
  50. {fastled-1.1.36 → fastled-1.1.37}/examples/FxEngine/FxEngine.ino +0 -0
  51. {fastled-1.1.36 → fastled-1.1.37}/examples/Noise/Noise.ino +0 -0
  52. {fastled-1.1.36 → fastled-1.1.37}/examples/NoisePlayground/NoisePlayground.ino +0 -0
  53. {fastled-1.1.36 → fastled-1.1.37}/examples/NoisePlusPalette/NoisePlusPalette.ino +0 -0
  54. {fastled-1.1.36 → fastled-1.1.37}/examples/OctoWS2811/OctoWS2811.ino +0 -0
  55. {fastled-1.1.36 → fastled-1.1.37}/examples/Pacifica/Pacifica.ino +0 -0
  56. {fastled-1.1.36 → fastled-1.1.37}/examples/Pride2015/Pride2015.ino +0 -0
  57. {fastled-1.1.36 → fastled-1.1.37}/examples/TwinkleFox/TwinkleFox.ino +0 -0
  58. {fastled-1.1.36 → fastled-1.1.37}/examples/Video/Gfx2Video/Gfx2Video.ino +0 -0
  59. {fastled-1.1.36 → fastled-1.1.37}/examples/WasmScreenCoords/WasmScreenCoords.ino +0 -0
  60. {fastled-1.1.36 → fastled-1.1.37}/examples/Water/Water.ino +0 -0
  61. {fastled-1.1.36 → fastled-1.1.37}/examples/XYMatrix/XYMatrix.ino +0 -0
  62. {fastled-1.1.36 → fastled-1.1.37}/examples/wasm/wasm.ino +0 -0
  63. {fastled-1.1.36 → fastled-1.1.37}/install +0 -0
  64. {fastled-1.1.36 → fastled-1.1.37}/lint +0 -0
  65. {fastled-1.1.36 → fastled-1.1.37}/pyproject.toml +0 -0
  66. {fastled-1.1.36 → fastled-1.1.37}/requirements.testing.txt +0 -0
  67. {fastled-1.1.36 → fastled-1.1.37}/setup.cfg +0 -0
  68. {fastled-1.1.36 → fastled-1.1.37}/setup.py +0 -0
  69. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/app.py +0 -0
  70. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/assets/example.txt +0 -0
  71. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/build_mode.py +0 -0
  72. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/cli.py +0 -0
  73. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/client_server.py +0 -0
  74. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/compile_server.py +0 -0
  75. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/compile_server_impl.py +0 -0
  76. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/docker_manager.py +0 -0
  77. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/filewatcher.py +0 -0
  78. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/keyboard.py +0 -0
  79. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/open_browser.py +0 -0
  80. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/parse_args.py +0 -0
  81. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/paths.py +0 -0
  82. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/select_sketch_directory.py +0 -0
  83. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/settings.py +0 -0
  84. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/sketch.py +0 -0
  85. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/spinner.py +0 -0
  86. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/string_diff.py +0 -0
  87. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/types.py +0 -0
  88. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/util.py +0 -0
  89. {fastled-1.1.36 → fastled-1.1.37}/src/fastled/web_compile.py +0 -0
  90. {fastled-1.1.36 → fastled-1.1.37}/src/fastled.egg-info/dependency_links.txt +0 -0
  91. {fastled-1.1.36 → fastled-1.1.37}/src/fastled.egg-info/entry_points.txt +0 -0
  92. {fastled-1.1.36 → fastled-1.1.37}/src/fastled.egg-info/requires.txt +0 -0
  93. {fastled-1.1.36 → fastled-1.1.37}/src/fastled.egg-info/top_level.txt +0 -0
  94. {fastled-1.1.36 → fastled-1.1.37}/test +0 -0
  95. {fastled-1.1.36 → fastled-1.1.37}/tests/test_bad_ino.py +0 -0
  96. {fastled-1.1.36 → fastled-1.1.37}/tests/test_cli.py +0 -0
  97. {fastled-1.1.36 → fastled-1.1.37}/tests/test_compile_server.py +0 -0
  98. {fastled-1.1.36 → fastled-1.1.37}/tests/test_docker_linux_on_windows.py +0 -0
  99. {fastled-1.1.36 → fastled-1.1.37}/tests/test_embedded_data.py +0 -0
  100. {fastled-1.1.36 → fastled-1.1.37}/tests/test_examples.py +0 -0
  101. {fastled-1.1.36 → fastled-1.1.37}/tests/test_filechanger.py +0 -0
  102. {fastled-1.1.36 → fastled-1.1.37}/tests/test_ino/bad/bad.ino +0 -0
  103. {fastled-1.1.36 → fastled-1.1.37}/tests/test_ino/embedded/data/bigdata.dat +0 -0
  104. {fastled-1.1.36 → fastled-1.1.37}/tests/test_ino/embedded/wasm.ino +0 -0
  105. {fastled-1.1.36 → fastled-1.1.37}/tests/test_ino/wasm/wasm.ino +0 -0
  106. {fastled-1.1.36 → fastled-1.1.37}/tests/test_project_init.py +0 -0
  107. {fastled-1.1.36 → fastled-1.1.37}/tests/test_server_and_client_seperatly.py +0 -0
  108. {fastled-1.1.36 → fastled-1.1.37}/tests/test_webcompile.py +0 -0
  109. {fastled-1.1.36 → fastled-1.1.37}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.1.36
3
+ Version: 1.1.37
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -163,6 +163,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` is
163
163
 
164
164
  # Revisions
165
165
 
166
+ * 1.1.37 - `Test.test_examples()` is now unit tested to work correctly.
166
167
  * 1.1.36 - We now have an api. `from fastled import Api` and `from fastled import Test` for testing.
167
168
  * 1.1.35 - When searching for files cap the limit at a high amount to prevent hang.
168
169
  * 1.1.34 - On windows check to make sure we are in linux container mode, if not try to switch and if that fails then use `--web` compiler.
@@ -140,6 +140,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` is
140
140
 
141
141
  # Revisions
142
142
 
143
+ * 1.1.37 - `Test.test_examples()` is now unit tested to work correctly.
143
144
  * 1.1.36 - We now have an api. `from fastled import Api` and `from fastled import Test` for testing.
144
145
  * 1.1.35 - When searching for files cap the limit at a high amount to prevent hang.
145
146
  * 1.1.34 - On windows check to make sure we are in linux container mode, if not try to switch and if that fails then use `--web` compiler.
@@ -1,11 +1,13 @@
1
1
  """FastLED Wasm Compiler package."""
2
2
 
3
+ # context
4
+ from contextlib import contextmanager
3
5
  from pathlib import Path
4
6
 
5
7
  from .compile_server import CompileServer
6
8
  from .types import WebCompileResult
7
9
 
8
- __version__ = "1.1.36"
10
+ __version__ = "1.1.37"
9
11
 
10
12
 
11
13
  class Api:
@@ -27,13 +29,14 @@ class Api:
27
29
 
28
30
  @staticmethod
29
31
  def web_compile(
30
- directory, host: str | CompileServer | None = None
32
+ directory: Path | str, host: str | CompileServer | None = None
31
33
  ) -> WebCompileResult:
32
34
  from fastled.web_compile import web_compile
33
35
 
34
36
  if isinstance(host, CompileServer):
35
37
  host = host.url()
36
-
38
+ if isinstance(directory, str):
39
+ directory = Path(directory)
37
40
  out: WebCompileResult = web_compile(directory, host)
38
41
  return out
39
42
 
@@ -56,12 +59,33 @@ class Api:
56
59
  )
57
60
  return out
58
61
 
62
+ @staticmethod
63
+ @contextmanager
64
+ def server(
65
+ sketch_directory: Path | None = None,
66
+ interactive=False,
67
+ auto_updates=None,
68
+ auto_start=True,
69
+ container_name: str | None = None,
70
+ ):
71
+ server = Api.spawn_server(
72
+ sketch_directory=sketch_directory,
73
+ interactive=interactive,
74
+ auto_updates=auto_updates,
75
+ auto_start=auto_start,
76
+ container_name=container_name,
77
+ )
78
+ try:
79
+ yield server
80
+ finally:
81
+ server.stop()
82
+
59
83
 
60
84
  class Test:
61
85
  @staticmethod
62
86
  def test_examples(
63
87
  examples: list[str] | None = None, host: str | CompileServer | None = None
64
- ) -> Exception | None:
88
+ ) -> dict[str, Exception]:
65
89
  from fastled.test.examples import test_examples
66
90
 
67
91
  if isinstance(host, CompileServer):
@@ -42,7 +42,7 @@ def project_init(
42
42
  Initialize a new FastLED project.
43
43
  """
44
44
  host = host or DEFAULT_URL
45
- outputdir = outputdir or Path("fastled")
45
+ outputdir = Path(outputdir) if outputdir is not None else Path("fastled")
46
46
  if example == "PROMPT" or example is None:
47
47
  try:
48
48
  example = _prompt_for_example()
@@ -0,0 +1,31 @@
1
+ from tempfile import TemporaryDirectory
2
+
3
+
4
+ def test_examples(
5
+ examples: list[str] | None = None, host: str | None = None
6
+ ) -> dict[str, Exception]:
7
+ """Test the examples in the given directory."""
8
+ from fastled import Api
9
+
10
+ out: dict[str, Exception] = {}
11
+ examples = Api.get_examples() if examples is None else examples
12
+ with TemporaryDirectory() as tmpdir:
13
+ for example in examples:
14
+ print(f"Initializing example: {example}")
15
+ sketch_dir = Api.project_init(example, outputdir=tmpdir, host=host)
16
+ print(f"Project initialized at: {sketch_dir}")
17
+ print(f"Compiling example: {example}")
18
+ result = Api.web_compile(sketch_dir, host=host)
19
+ if not result.success:
20
+ out[example] = Exception(result.stdout)
21
+ return out
22
+
23
+
24
+ def unit_test() -> None:
25
+ out = test_examples()
26
+ if out:
27
+ raise RuntimeError(f"Failed tests: {out}")
28
+
29
+
30
+ if __name__ == "__main__":
31
+ unit_test()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.1.36
3
+ Version: 1.1.37
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -163,6 +163,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` is
163
163
 
164
164
  # Revisions
165
165
 
166
+ * 1.1.37 - `Test.test_examples()` is now unit tested to work correctly.
166
167
  * 1.1.36 - We now have an api. `from fastled import Api` and `from fastled import Test` for testing.
167
168
  * 1.1.35 - When searching for files cap the limit at a high amount to prevent hang.
168
169
  * 1.1.34 - On windows check to make sure we are in linux container mode, if not try to switch and if that fails then use `--web` compiler.
@@ -89,6 +89,7 @@ src/fastled.egg-info/requires.txt
89
89
  src/fastled.egg-info/top_level.txt
90
90
  src/fastled/assets/example.txt
91
91
  src/fastled/test/examples.py
92
+ tests/test_api.py
92
93
  tests/test_bad_ino.py
93
94
  tests/test_cli.py
94
95
  tests/test_compile_server.py
@@ -0,0 +1,24 @@
1
+ """
2
+ Unit test file.
3
+ """
4
+
5
+ import unittest
6
+
7
+ ENABLED = False
8
+
9
+
10
+ class ApiTester(unittest.TestCase):
11
+ """Main tester class."""
12
+
13
+ @unittest.skipUnless(ENABLED, "This test takes a long time.")
14
+ def test_command(self) -> None:
15
+ """Test command line interface (CLI)."""
16
+ from fastled import Api, Test
17
+
18
+ with Api.server() as server:
19
+ out = Test.test_examples(host=server)
20
+ self.assertEqual(0, len(out), f"Failed tests: {out}")
21
+
22
+
23
+ if __name__ == "__main__":
24
+ unittest.main()
@@ -1,16 +0,0 @@
1
- from fastled import WebCompileResult
2
-
3
-
4
- def test_examples(
5
- examples: list[str] | None = None, host: str | None = None
6
- ) -> Exception | None:
7
- """Test the examples in the given directory."""
8
- from fastled import Api
9
-
10
- examples = Api.get_examples() if examples is None else examples
11
- for example in examples:
12
- print(f"Compiling example: {example}")
13
- out: WebCompileResult = Api.web_compile(example, host=host)
14
- if not out.success:
15
- return Exception(out.stdout)
16
- return None
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes