fastled 1.2.0__tar.gz → 1.2.3__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 (114) hide show
  1. {fastled-1.2.0 → fastled-1.2.3}/.github/workflows/test_build_exe.yml +1 -1
  2. {fastled-1.2.0 → fastled-1.2.3}/PKG-INFO +7 -3
  3. {fastled-1.2.0 → fastled-1.2.3}/README.md +5 -1
  4. {fastled-1.2.0 → fastled-1.2.3}/pyproject.toml +2 -2
  5. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/__init__.py +34 -1
  6. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/compile_server_impl.py +5 -9
  7. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/docker_manager.py +29 -0
  8. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/open_browser.py +13 -18
  9. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/parse_args.py +15 -2
  10. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/settings.py +4 -0
  11. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/site/build.py +8 -1
  12. {fastled-1.2.0 → fastled-1.2.3}/src/fastled.egg-info/PKG-INFO +7 -3
  13. {fastled-1.2.0 → fastled-1.2.3}/src/fastled.egg-info/SOURCES.txt +0 -1
  14. {fastled-1.2.0 → fastled-1.2.3}/src/fastled.egg-info/requires.txt +1 -1
  15. {fastled-1.2.0 → fastled-1.2.3}/tests/test_build_examples.py +8 -0
  16. {fastled-1.2.0 → fastled-1.2.3}/tests/test_examples.py +3 -2
  17. {fastled-1.2.0 → fastled-1.2.3}/tests/test_project_init.py +7 -4
  18. fastled-1.2.0/.github/workflows/check_pfx_b64.yml +0 -28
  19. {fastled-1.2.0 → fastled-1.2.3}/.aiderignore +0 -0
  20. {fastled-1.2.0 → fastled-1.2.3}/.github/workflows/build_multi_docker_image.yml +0 -0
  21. {fastled-1.2.0 → fastled-1.2.3}/.github/workflows/build_webpage.yml +0 -0
  22. {fastled-1.2.0 → fastled-1.2.3}/.github/workflows/lint.yml +0 -0
  23. {fastled-1.2.0 → fastled-1.2.3}/.github/workflows/publish_release.yml +0 -0
  24. {fastled-1.2.0 → fastled-1.2.3}/.github/workflows/test_macos.yml +0 -0
  25. {fastled-1.2.0 → fastled-1.2.3}/.github/workflows/test_ubuntu.yml +0 -0
  26. {fastled-1.2.0 → fastled-1.2.3}/.github/workflows/test_win.yml +0 -0
  27. {fastled-1.2.0 → fastled-1.2.3}/.gitignore +0 -0
  28. {fastled-1.2.0 → fastled-1.2.3}/.pylintrc +0 -0
  29. {fastled-1.2.0 → fastled-1.2.3}/.vscode/launch.json +0 -0
  30. {fastled-1.2.0 → fastled-1.2.3}/.vscode/settings.json +0 -0
  31. {fastled-1.2.0 → fastled-1.2.3}/.vscode/tasks.json +0 -0
  32. {fastled-1.2.0 → fastled-1.2.3}/LICENSE +0 -0
  33. {fastled-1.2.0 → fastled-1.2.3}/MANIFEST.in +0 -0
  34. {fastled-1.2.0 → fastled-1.2.3}/RELEASE.md +0 -0
  35. {fastled-1.2.0 → fastled-1.2.3}/TODO.md +0 -0
  36. {fastled-1.2.0 → fastled-1.2.3}/build_exe.py +0 -0
  37. {fastled-1.2.0 → fastled-1.2.3}/build_site.py +0 -0
  38. {fastled-1.2.0 → fastled-1.2.3}/clean +0 -0
  39. {fastled-1.2.0 → fastled-1.2.3}/examples/Blink/Blink.ino +0 -0
  40. {fastled-1.2.0 → fastled-1.2.3}/examples/Chromancer/Chromancer.ino +0 -0
  41. {fastled-1.2.0 → fastled-1.2.3}/examples/Chromancer/detail.h +0 -0
  42. {fastled-1.2.0 → fastled-1.2.3}/examples/Chromancer/gary_woos_wled_port/gary_woos_wled_ledmap.h +0 -0
  43. {fastled-1.2.0 → fastled-1.2.3}/examples/Chromancer/gary_woos_wled_port/presets.json +0 -0
  44. {fastled-1.2.0 → fastled-1.2.3}/examples/Chromancer/gary_woos_wled_port/presets.min.json +0 -0
  45. {fastled-1.2.0 → fastled-1.2.3}/examples/Chromancer/gen.py +0 -0
  46. {fastled-1.2.0 → fastled-1.2.3}/examples/Chromancer/mapping.h +0 -0
  47. {fastled-1.2.0 → fastled-1.2.3}/examples/Chromancer/net.h +0 -0
  48. {fastled-1.2.0 → fastled-1.2.3}/examples/Chromancer/output.json +0 -0
  49. {fastled-1.2.0 → fastled-1.2.3}/examples/Chromancer/ripple.h +0 -0
  50. {fastled-1.2.0 → fastled-1.2.3}/examples/Chromancer/screenmap.json.h +0 -0
  51. {fastled-1.2.0 → fastled-1.2.3}/examples/ColorPalette/ColorPalette.ino +0 -0
  52. {fastled-1.2.0 → fastled-1.2.3}/examples/ColorTemperature/ColorTemperature.ino +0 -0
  53. {fastled-1.2.0 → fastled-1.2.3}/examples/Cylon/Cylon.ino +0 -0
  54. {fastled-1.2.0 → fastled-1.2.3}/examples/DemoReel100/DemoReel100.ino +0 -0
  55. {fastled-1.2.0 → fastled-1.2.3}/examples/Esp32Rmt51/Esp32Rmt51.ino +0 -0
  56. {fastled-1.2.0 → fastled-1.2.3}/examples/EspI2SDemo/EspI2SDemo.ino +0 -0
  57. {fastled-1.2.0 → fastled-1.2.3}/examples/Fire2012/Fire2012.ino +0 -0
  58. {fastled-1.2.0 → fastled-1.2.3}/examples/Fire2012WithPalette/Fire2012WithPalette.ino +0 -0
  59. {fastled-1.2.0 → fastled-1.2.3}/examples/FirstLight/FirstLight.ino +0 -0
  60. {fastled-1.2.0 → fastled-1.2.3}/examples/FxEngine/FxEngine.ino +0 -0
  61. {fastled-1.2.0 → fastled-1.2.3}/examples/Noise/Noise.ino +0 -0
  62. {fastled-1.2.0 → fastled-1.2.3}/examples/NoisePlayground/NoisePlayground.ino +0 -0
  63. {fastled-1.2.0 → fastled-1.2.3}/examples/NoisePlusPalette/NoisePlusPalette.ino +0 -0
  64. {fastled-1.2.0 → fastled-1.2.3}/examples/OctoWS2811/OctoWS2811.ino +0 -0
  65. {fastled-1.2.0 → fastled-1.2.3}/examples/Pacifica/Pacifica.ino +0 -0
  66. {fastled-1.2.0 → fastled-1.2.3}/examples/Pride2015/Pride2015.ino +0 -0
  67. {fastled-1.2.0 → fastled-1.2.3}/examples/TwinkleFox/TwinkleFox.ino +0 -0
  68. {fastled-1.2.0 → fastled-1.2.3}/examples/Video/Gfx2Video/Gfx2Video.ino +0 -0
  69. {fastled-1.2.0 → fastled-1.2.3}/examples/WasmScreenCoords/WasmScreenCoords.ino +0 -0
  70. {fastled-1.2.0 → fastled-1.2.3}/examples/Water/Water.ino +0 -0
  71. {fastled-1.2.0 → fastled-1.2.3}/examples/XYMatrix/XYMatrix.ino +0 -0
  72. {fastled-1.2.0 → fastled-1.2.3}/examples/wasm/wasm.ino +0 -0
  73. {fastled-1.2.0 → fastled-1.2.3}/install +0 -0
  74. {fastled-1.2.0 → fastled-1.2.3}/lint +0 -0
  75. {fastled-1.2.0 → fastled-1.2.3}/requirements.testing.txt +0 -0
  76. {fastled-1.2.0 → fastled-1.2.3}/setup.cfg +0 -0
  77. {fastled-1.2.0 → fastled-1.2.3}/setup.py +0 -0
  78. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/app.py +0 -0
  79. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/assets/example.txt +0 -0
  80. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/cli.py +0 -0
  81. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/client_server.py +0 -0
  82. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/compile_server.py +0 -0
  83. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/filewatcher.py +0 -0
  84. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/keyboard.py +0 -0
  85. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/live_client.py +0 -0
  86. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/paths.py +0 -0
  87. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/project_init.py +0 -0
  88. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/select_sketch_directory.py +0 -0
  89. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/sketch.py +0 -0
  90. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/spinner.py +0 -0
  91. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/string_diff.py +0 -0
  92. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  93. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/test/examples.py +0 -0
  94. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/types.py +0 -0
  95. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/util.py +0 -0
  96. {fastled-1.2.0 → fastled-1.2.3}/src/fastled/web_compile.py +0 -0
  97. {fastled-1.2.0 → fastled-1.2.3}/src/fastled.egg-info/dependency_links.txt +0 -0
  98. {fastled-1.2.0 → fastled-1.2.3}/src/fastled.egg-info/entry_points.txt +0 -0
  99. {fastled-1.2.0 → fastled-1.2.3}/src/fastled.egg-info/top_level.txt +0 -0
  100. {fastled-1.2.0 → fastled-1.2.3}/test +0 -0
  101. {fastled-1.2.0 → fastled-1.2.3}/tests/test_api.py +0 -0
  102. {fastled-1.2.0 → fastled-1.2.3}/tests/test_bad_ino.py +0 -0
  103. {fastled-1.2.0 → fastled-1.2.3}/tests/test_cli.py +0 -0
  104. {fastled-1.2.0 → fastled-1.2.3}/tests/test_compile_server.py +0 -0
  105. {fastled-1.2.0 → fastled-1.2.3}/tests/test_docker_linux_on_windows.py +0 -0
  106. {fastled-1.2.0 → fastled-1.2.3}/tests/test_embedded_data.py +0 -0
  107. {fastled-1.2.0 → fastled-1.2.3}/tests/test_filechanger.py +0 -0
  108. {fastled-1.2.0 → fastled-1.2.3}/tests/test_ino/bad/bad.ino +0 -0
  109. {fastled-1.2.0 → fastled-1.2.3}/tests/test_ino/embedded/data/bigdata.dat +0 -0
  110. {fastled-1.2.0 → fastled-1.2.3}/tests/test_ino/embedded/wasm.ino +0 -0
  111. {fastled-1.2.0 → fastled-1.2.3}/tests/test_ino/wasm/wasm.ino +0 -0
  112. {fastled-1.2.0 → fastled-1.2.3}/tests/test_server_and_client_seperatly.py +0 -0
  113. {fastled-1.2.0 → fastled-1.2.3}/tests/test_webcompile.py +0 -0
  114. {fastled-1.2.0 → fastled-1.2.3}/upload_package.sh +0 -0
@@ -1,4 +1,4 @@
1
- name: Build Executables
1
+ name: Test Build Executables
2
2
 
3
3
  on: [push]
4
4
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.2.0
3
+ Version: 1.2.3
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -13,13 +13,13 @@ License-File: LICENSE
13
13
  Requires-Dist: docker>=7.1.0
14
14
  Requires-Dist: httpx>=0.28.1
15
15
  Requires-Dist: watchdog>=6.0.0
16
- Requires-Dist: livereload>=2.7.0
17
16
  Requires-Dist: download>=0.3.5
18
17
  Requires-Dist: filelock>=3.16.1
19
18
  Requires-Dist: disklru>=2.0.1
20
19
  Requires-Dist: appdirs>=1.4.4
21
20
  Requires-Dist: rapidfuzz>=3.10.1
22
21
  Requires-Dist: progress>=1.6
22
+ Requires-Dist: nodejs-bin[cmd]
23
23
 
24
24
  # FastLED Wasm compiler
25
25
 
@@ -27,10 +27,11 @@ Requires-Dist: progress>=1.6
27
27
  [![MacOS_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml)
28
28
  [![Ubuntu_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml)
29
29
  [![Win_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml)
30
+ [![Test Build Executables](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml)
30
31
 
31
32
  [![Build and Push Multi Docker Image](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml)
32
- [![Build Executables](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml)
33
33
  [![Publish Release](https://github.com/zackees/fastled-wasm/actions/workflows/publish_release.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/publish_release.yml)
34
+ [![Build Webpage](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml)
34
35
 
35
36
 
36
37
 
@@ -262,8 +263,11 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
262
263
  Q: How can I get the compiled size of my FastLED sketch smaller?
263
264
  A: A big chunk of space is being used by unnecessary javascript `emscripten` bundling. The wasm_compiler_settings.py file in the FastLED repo can tweak this.
264
265
 
266
+
265
267
  # Revisions
266
268
 
269
+ * 1.1.23 - Fixes missing `live-server` on platforms that don't have it already.
270
+ * 1.2.22 - Added `--purge` and added docker api at __init__.
267
271
  * 1.2.00 - `fastled.exe` is now a signed binary on windows, however it's a self signed binary so you'll still get the warning on the first open. There's been a small api change between the server and the client for fetching projects.
268
272
  * 1.1.69 - Changed the binary name to `fastled.exe` instead of something like `fastled-windows-x64.exe`
269
273
  * 1.1.68 - Add a site builder to fastled.Test which generates a website with a bunch of demos. This is used to build the demo site automatically.
@@ -4,10 +4,11 @@
4
4
  [![MacOS_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml)
5
5
  [![Ubuntu_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml)
6
6
  [![Win_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml)
7
+ [![Test Build Executables](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml)
7
8
 
8
9
  [![Build and Push Multi Docker Image](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml)
9
- [![Build Executables](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml)
10
10
  [![Publish Release](https://github.com/zackees/fastled-wasm/actions/workflows/publish_release.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/publish_release.yml)
11
+ [![Build Webpage](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml)
11
12
 
12
13
 
13
14
 
@@ -239,8 +240,11 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
239
240
  Q: How can I get the compiled size of my FastLED sketch smaller?
240
241
  A: A big chunk of space is being used by unnecessary javascript `emscripten` bundling. The wasm_compiler_settings.py file in the FastLED repo can tweak this.
241
242
 
243
+
242
244
  # Revisions
243
245
 
246
+ * 1.1.23 - Fixes missing `live-server` on platforms that don't have it already.
247
+ * 1.2.22 - Added `--purge` and added docker api at __init__.
244
248
  * 1.2.00 - `fastled.exe` is now a signed binary on windows, however it's a self signed binary so you'll still get the warning on the first open. There's been a small api change between the server and the client for fetching projects.
245
249
  * 1.1.69 - Changed the binary name to `fastled.exe` instead of something like `fastled-windows-x64.exe`
246
250
  * 1.1.68 - Add a site builder to fastled.Test which generates a website with a bunch of demos. This is used to build the demo site automatically.
@@ -14,13 +14,13 @@ dependencies = [
14
14
  "docker>=7.1.0",
15
15
  "httpx>=0.28.1",
16
16
  "watchdog>=6.0.0",
17
- "livereload>=2.7.0",
18
17
  "download>=0.3.5",
19
18
  "filelock>=3.16.1",
20
19
  "disklru>=2.0.1",
21
20
  "appdirs>=1.4.4",
22
21
  "rapidfuzz>=3.10.1",
23
- "progress>=1.6"
22
+ "progress>=1.6",
23
+ "nodejs-bin[cmd]",
24
24
  ]
25
25
 
26
26
  dynamic = ["version"]
@@ -13,7 +13,7 @@ from .types import BuildMode, CompileResult, CompileServerError
13
13
  # IMPORTANT! There's a bug in github which will REJECT any version update
14
14
  # that has any other change in the repo. Please bump the version as the
15
15
  # ONLY change in a commit, or else the pypi update and the release will fail.
16
- __version__ = "1.2.0"
16
+ __version__ = "1.2.3"
17
17
 
18
18
 
19
19
  class Api:
@@ -112,7 +112,40 @@ class Api:
112
112
  server.stop()
113
113
 
114
114
 
115
+ class Docker:
116
+ @staticmethod
117
+ def is_installed() -> bool:
118
+ from fastled.docker_manager import DockerManager
119
+
120
+ return DockerManager.is_docker_installed()
121
+
122
+ @staticmethod
123
+ def is_running() -> bool:
124
+ from fastled.docker_manager import DockerManager
125
+
126
+ return DockerManager.is_running()
127
+
128
+ @staticmethod
129
+ def is_container_running(container_name: str | None = None) -> bool:
130
+ # from fastled.docker import is_container_running
131
+ from fastled.docker_manager import DockerManager
132
+ from fastled.settings import CONTAINER_NAME
133
+
134
+ docker = DockerManager()
135
+ container_name = container_name or CONTAINER_NAME
136
+ return docker.is_container_running(container_name)
137
+
138
+ @staticmethod
139
+ def purge() -> None:
140
+ from fastled.docker_manager import DockerManager
141
+ from fastled.settings import CONTAINER_NAME
142
+
143
+ docker = DockerManager()
144
+ docker.purge(CONTAINER_NAME)
145
+
146
+
115
147
  class Test:
148
+ __test__ = False # This prevents unittest from recognizing it as a test class.
116
149
 
117
150
  @staticmethod
118
151
  def can_run_local_docker_tests() -> bool:
@@ -12,14 +12,10 @@ from fastled.docker_manager import (
12
12
  DockerManager,
13
13
  RunningContainer,
14
14
  )
15
- from fastled.settings import SERVER_PORT
15
+ from fastled.settings import DEFAULT_CONTAINER_NAME, IMAGE_NAME, SERVER_PORT
16
16
  from fastled.sketch import looks_like_fastled_repo
17
17
  from fastled.types import BuildMode, CompileResult, CompileServerError
18
18
 
19
- _IMAGE_NAME = "niteris/fastled-wasm"
20
- _DEFAULT_CONTAINER_NAME = "fastled-wasm-compiler"
21
-
22
-
23
19
  SERVER_OPTIONS = [
24
20
  "--allow-shutdown", # Allow the server to be shut down without a force kill.
25
21
  "--no-auto-update", # Don't auto live updates from the git repo.
@@ -46,7 +42,7 @@ class CompileServerImpl:
46
42
  auto_start: bool = True,
47
43
  container_name: str | None = None,
48
44
  ) -> None:
49
- container_name = container_name or _DEFAULT_CONTAINER_NAME
45
+ container_name = container_name or DEFAULT_CONTAINER_NAME
50
46
  if interactive and not mapped_dir:
51
47
  raise ValueError(
52
48
  "Interactive mode requires a mapped directory point to a sketch"
@@ -178,7 +174,7 @@ class CompileServerImpl:
178
174
  else:
179
175
  upgrade = self.auto_updates
180
176
  self.docker.validate_or_download_image(
181
- image_name=_IMAGE_NAME, tag="main", upgrade=upgrade
177
+ image_name=IMAGE_NAME, tag="main", upgrade=upgrade
182
178
  )
183
179
  DISK_CACHE.put("last-update", now_str)
184
180
 
@@ -214,7 +210,7 @@ class CompileServerImpl:
214
210
  cmd_str = subprocess.list2cmdline(server_command)
215
211
  if not self.interactive:
216
212
  container: Container = self.docker.run_container_detached(
217
- image_name=_IMAGE_NAME,
213
+ image_name=IMAGE_NAME,
218
214
  tag="main",
219
215
  container_name=self.container_name,
220
216
  command=cmd_str,
@@ -228,7 +224,7 @@ class CompileServerImpl:
228
224
  return port
229
225
  else:
230
226
  self.docker.run_container_interactive(
231
- image_name=_IMAGE_NAME,
227
+ image_name=IMAGE_NAME,
232
228
  tag="main",
233
229
  container_name=self.container_name,
234
230
  command=cmd_str,
@@ -610,6 +610,35 @@ class DockerManager:
610
610
  print(f"Container {container_name} not found.")
611
611
  return False
612
612
 
613
+ def purge(self, image_name: str) -> None:
614
+ """
615
+ Remove all containers and images associated with the given image name.
616
+
617
+ Args:
618
+ image_name: The name of the image to purge (without tag)
619
+ """
620
+ print(f"Purging all containers and images for {image_name}...")
621
+
622
+ # Remove all containers using this image
623
+ try:
624
+ containers = self.client.containers.list(all=True)
625
+ for container in containers:
626
+ if any(image_name in tag for tag in container.image.tags):
627
+ print(f"Removing container {container.name}")
628
+ container.remove(force=True)
629
+ except Exception as e:
630
+ print(f"Error removing containers: {e}")
631
+
632
+ # Remove all images with this name
633
+ try:
634
+ images = self.client.images.list()
635
+ for image in images:
636
+ if any(image_name in tag for tag in image.tags):
637
+ print(f"Removing image {image.tags}")
638
+ self.client.images.remove(image.id, force=True)
639
+ except Exception as e:
640
+ print(f"Error removing images: {e}")
641
+
613
642
 
614
643
  def main():
615
644
  # Register SIGINT handler
@@ -1,23 +1,22 @@
1
1
  import os
2
+ import shutil
2
3
  import socket
4
+ import subprocess
3
5
  import sys
4
6
  from multiprocessing import Process
5
7
  from pathlib import Path
6
8
 
7
- from livereload import Server
8
-
9
9
  DEFAULT_PORT = 8081
10
10
 
11
11
 
12
- def _open_browser_python(fastled_js: Path, port: int) -> Server:
12
+ def _open_browser_python(fastled_js: Path) -> None:
13
13
  """Start livereload server in the fastled_js directory using API"""
14
- print(f"\nStarting livereload server in {fastled_js} on port {port}")
15
-
16
- # server = Server()
17
- # server.watch(str(fastled_js / "index.html"), delay=0.1)
18
- # server.setHeader("Cache-Control", "no-cache")
19
- # server.serve(root=str(fastled_js), port=port, open_url_delay=0.5)
20
- # return server
14
+ print(f"\nStarting livereload server in {fastled_js}")
15
+ if shutil.which("live-server") is None:
16
+ print("live-server not found. Installing it with the embedded npm...")
17
+ subprocess.run(
18
+ [sys.executable, "-m", "nodejs.npm", "install", "-g", "live-server"]
19
+ )
21
20
  os.system(f"cd {fastled_js} && live-server")
22
21
 
23
22
 
@@ -31,10 +30,10 @@ def _find_open_port(start_port: int) -> int:
31
30
  port += 1
32
31
 
33
32
 
34
- def _run_server(fastled_js: Path, port: int) -> None:
33
+ def _run_server(fastled_js: Path) -> None:
35
34
  """Function to run in separate process that starts the livereload server"""
36
35
  sys.stderr = open(os.devnull, "w") # Suppress stderr output
37
- _open_browser_python(fastled_js, port)
36
+ _open_browser_python(fastled_js)
38
37
  try:
39
38
  # Keep the process running
40
39
  while True:
@@ -43,16 +42,12 @@ def _run_server(fastled_js: Path, port: int) -> None:
43
42
  print("\nShutting down livereload server...")
44
43
 
45
44
 
46
- def open_browser_process(fastled_js: Path, port: int | None = None) -> Process:
45
+ def open_browser_process(fastled_js: Path) -> Process:
47
46
  """Start livereload server in the fastled_js directory and return the process"""
48
- if port is None:
49
- port = DEFAULT_PORT
50
-
51
- port = _find_open_port(port)
52
47
 
53
48
  process = Process(
54
49
  target=_run_server,
55
- args=(fastled_js, port),
50
+ args=(fastled_js,),
56
51
  daemon=True,
57
52
  )
58
53
  process.start()
@@ -4,10 +4,9 @@ import sys
4
4
  from pathlib import Path
5
5
 
6
6
  from fastled import __version__
7
- from fastled.docker_manager import DockerManager
8
7
  from fastled.project_init import project_init
9
8
  from fastled.select_sketch_directory import select_sketch_directory
10
- from fastled.settings import DEFAULT_URL
9
+ from fastled.settings import DEFAULT_URL, IMAGE_NAME
11
10
  from fastled.sketch import (
12
11
  find_sketch_directories,
13
12
  looks_like_fastled_repo,
@@ -86,6 +85,11 @@ def parse_args() -> argparse.Namespace:
86
85
  action="store_true",
87
86
  help="Run the server in the current directory, volume mapping fastled if we are in the repo",
88
87
  )
88
+ parser.add_argument(
89
+ "--purge",
90
+ action="store_true",
91
+ help="Remove all FastLED containers and images",
92
+ )
89
93
 
90
94
  build_mode = parser.add_mutually_exclusive_group()
91
95
  build_mode.add_argument("--debug", action="store_true", help="Build in debug mode")
@@ -103,6 +107,13 @@ def parse_args() -> argparse.Namespace:
103
107
 
104
108
  args = parser.parse_args()
105
109
 
110
+ if args.purge:
111
+ from fastled.docker_manager import DockerManager
112
+
113
+ docker = DockerManager()
114
+ docker.purge(IMAGE_NAME)
115
+ sys.exit(0)
116
+
106
117
  if args.init:
107
118
  example = args.init if args.init is not True else None
108
119
  args.directory = project_init(example, args.directory)
@@ -122,6 +133,8 @@ def parse_args() -> argparse.Namespace:
122
133
  and not args.web
123
134
  and not args.server
124
135
  ):
136
+ from fastled.docker_manager import DockerManager
137
+
125
138
  if DockerManager.is_docker_installed():
126
139
  if not DockerManager.ensure_linux_containers_for_windows():
127
140
  print(
@@ -7,3 +7,7 @@ PLATFORM_TAG: str = "-arm64" if IS_ARM else ""
7
7
  CONTAINER_NAME = f"fastled-wasm-compiler{PLATFORM_TAG}"
8
8
  DEFAULT_URL = str(os.environ.get("FASTLED_URL", "https://fastled.onrender.com"))
9
9
  SERVER_PORT = 9021
10
+
11
+ IMAGE_NAME = "niteris/fastled-wasm"
12
+ DEFAULT_CONTAINER_NAME = "fastled-wasm-compiler"
13
+ # IMAGE_TAG = "main"
@@ -298,7 +298,14 @@ INDEX_TEMPLATE = """<!DOCTYPE html>
298
298
  """
299
299
 
300
300
 
301
- EXAMPLES = ["wasm", "Chromancer", "SdCard", "NoiseRing", "LuminescentGrand", "Water"]
301
+ EXAMPLES = [
302
+ "wasm",
303
+ "Chromancer",
304
+ "LuminescentGrand",
305
+ "fx/SdCard",
306
+ "fx/NoiseRing",
307
+ "fx/Water",
308
+ ]
302
309
 
303
310
 
304
311
  def _exec(cmd: str) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.2.0
3
+ Version: 1.2.3
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -13,13 +13,13 @@ License-File: LICENSE
13
13
  Requires-Dist: docker>=7.1.0
14
14
  Requires-Dist: httpx>=0.28.1
15
15
  Requires-Dist: watchdog>=6.0.0
16
- Requires-Dist: livereload>=2.7.0
17
16
  Requires-Dist: download>=0.3.5
18
17
  Requires-Dist: filelock>=3.16.1
19
18
  Requires-Dist: disklru>=2.0.1
20
19
  Requires-Dist: appdirs>=1.4.4
21
20
  Requires-Dist: rapidfuzz>=3.10.1
22
21
  Requires-Dist: progress>=1.6
22
+ Requires-Dist: nodejs-bin[cmd]
23
23
 
24
24
  # FastLED Wasm compiler
25
25
 
@@ -27,10 +27,11 @@ Requires-Dist: progress>=1.6
27
27
  [![MacOS_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_macos.yml)
28
28
  [![Ubuntu_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_ubuntu.yml)
29
29
  [![Win_Tests](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_win.yml)
30
+ [![Test Build Executables](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml)
30
31
 
31
32
  [![Build and Push Multi Docker Image](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_multi_docker_image.yml)
32
- [![Build Executables](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/test_build_exe.yml)
33
33
  [![Publish Release](https://github.com/zackees/fastled-wasm/actions/workflows/publish_release.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/publish_release.yml)
34
+ [![Build Webpage](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_webpage.yml)
34
35
 
35
36
 
36
37
 
@@ -262,8 +263,11 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
262
263
  Q: How can I get the compiled size of my FastLED sketch smaller?
263
264
  A: A big chunk of space is being used by unnecessary javascript `emscripten` bundling. The wasm_compiler_settings.py file in the FastLED repo can tweak this.
264
265
 
266
+
265
267
  # Revisions
266
268
 
269
+ * 1.1.23 - Fixes missing `live-server` on platforms that don't have it already.
270
+ * 1.2.22 - Added `--purge` and added docker api at __init__.
267
271
  * 1.2.00 - `fastled.exe` is now a signed binary on windows, however it's a self signed binary so you'll still get the warning on the first open. There's been a small api change between the server and the client for fetching projects.
268
272
  * 1.1.69 - Changed the binary name to `fastled.exe` instead of something like `fastled-windows-x64.exe`
269
273
  * 1.1.68 - Add a site builder to fastled.Test which generates a website with a bunch of demos. This is used to build the demo site automatically.
@@ -18,7 +18,6 @@ test
18
18
  upload_package.sh
19
19
  .github/workflows/build_multi_docker_image.yml
20
20
  .github/workflows/build_webpage.yml
21
- .github/workflows/check_pfx_b64.yml
22
21
  .github/workflows/lint.yml
23
22
  .github/workflows/publish_release.yml
24
23
  .github/workflows/test_build_exe.yml
@@ -1,10 +1,10 @@
1
1
  docker>=7.1.0
2
2
  httpx>=0.28.1
3
3
  watchdog>=6.0.0
4
- livereload>=2.7.0
5
4
  download>=0.3.5
6
5
  filelock>=3.16.1
7
6
  disklru>=2.0.1
8
7
  appdirs>=1.4.4
9
8
  rapidfuzz>=3.10.1
10
9
  progress>=1.6
10
+ nodejs-bin[cmd]
@@ -7,9 +7,17 @@ import unittest
7
7
  from fastled import Api, Test # type: ignore
8
8
 
9
9
 
10
+ def _enabled() -> bool:
11
+ """Check if this system can run the tests."""
12
+ from fastled import Test
13
+
14
+ return Test.can_run_local_docker_tests()
15
+
16
+
10
17
  class ApiTester(unittest.TestCase):
11
18
  """Main tester class."""
12
19
 
20
+ @unittest.skipUnless(_enabled(), "Skipping test on non-Linux system on github")
13
21
  def test_build_all_examples(self) -> None:
14
22
  """Test command line interface (CLI)."""
15
23
 
@@ -10,7 +10,7 @@ HERE = Path(__file__).parent
10
10
  TEST_DIR = HERE / "test_ino" / "wasm"
11
11
 
12
12
 
13
- EXAMPLES = ["Blink", "wasm", "Chromancer", "SdCard", "fx/NoiseRing"]
13
+ EXAMPLES = ["Blink", "wasm", "Chromancer", "fx/SdCard", "fx/NoiseRing"]
14
14
 
15
15
 
16
16
  def _enabled() -> bool:
@@ -35,7 +35,8 @@ class WebCompileTester(unittest.TestCase):
35
35
  # print out everything in the out dir
36
36
  for f in out.iterdir():
37
37
  print(f)
38
- self.assertTrue((out / example / f"{example}.ino").exists())
38
+ name = Path(example).name
39
+ self.assertTrue((out / example / f"{name}.ino").exists())
39
40
  # Test the web_compile function with actual server call
40
41
  result: CompileResult = server.web_compile(out / example)
41
42
  self.assertTrue(
@@ -9,7 +9,7 @@ HERE = Path(__file__).parent
9
9
  TEST_DIR = HERE / "test_ino" / "wasm"
10
10
 
11
11
 
12
- def _enabled() -> bool:
12
+ def _local_server_enabled() -> bool:
13
13
  """Check if this system can run the tests."""
14
14
  from fastled import Test
15
15
 
@@ -21,12 +21,15 @@ class ProjectInitTester(unittest.TestCase):
21
21
 
22
22
  def test_get_examples(self) -> None:
23
23
  """Test get_examples function."""
24
- with Api.server(auto_updates=True) as server:
25
- examples = get_examples(server.url())
24
+ if _local_server_enabled():
25
+ with Api.server(auto_updates=True) as server:
26
+ examples = get_examples(server.url())
27
+ else:
28
+ examples = get_examples()
26
29
  self.assertTrue(len(examples) > 0)
27
30
  self.assertTrue("wasm" in examples)
28
31
 
29
- @unittest.skipUnless(_enabled(), "This is not a fast test")
32
+ @unittest.skipUnless(_local_server_enabled(), "This is not a fast test")
30
33
  def test_compile(self) -> None:
31
34
  """Test web compilation functionality with real server."""
32
35
  # Test the web_compile function with actual server call
@@ -1,28 +0,0 @@
1
- name: Check PFX B64
2
-
3
-
4
- on: [push]
5
-
6
- jobs:
7
- build:
8
- runs-on: ${{ matrix.os }}
9
- strategy:
10
- matrix:
11
- os: [
12
- ubuntu-24.04, # linux/amd64
13
- windows-latest, # x64
14
- macos-latest, # arm64
15
- macos-13 # x86
16
- ]
17
- python-version: [3.11]
18
-
19
- steps:
20
- - uses: actions/checkout@v4
21
-
22
- - uses: actions/setup-python@v5
23
- with:
24
- python-version: ${{ matrix.python-version }}
25
-
26
- - name: Check FASTLED_PFX_B64 size
27
- run: |
28
- echo "FASTLED_PFX_B64 size: $(echo ${{ secrets.FASTLED_PFX_B64 }} | wc -c)"
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
File without changes
File without changes