fastled 1.1.39__tar.gz → 1.1.41__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 (110) hide show
  1. {fastled-1.1.39 → fastled-1.1.41}/PKG-INFO +8 -2
  2. {fastled-1.1.39 → fastled-1.1.41}/README.md +7 -1
  3. fastled-1.1.41/build_exe.py +48 -0
  4. {fastled-1.1.39 → fastled-1.1.41}/lint +7 -5
  5. {fastled-1.1.39 → fastled-1.1.41}/requirements.testing.txt +1 -0
  6. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/__init__.py +2 -5
  7. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/client_server.py +6 -0
  8. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/parse_args.py +1 -1
  9. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/project_init.py +5 -2
  10. {fastled-1.1.39 → fastled-1.1.41}/src/fastled.egg-info/PKG-INFO +8 -2
  11. {fastled-1.1.39 → fastled-1.1.41}/src/fastled.egg-info/SOURCES.txt +1 -0
  12. {fastled-1.1.39 → fastled-1.1.41}/test +2 -2
  13. fastled-1.1.41/tests/test_api.py +62 -0
  14. {fastled-1.1.39 → fastled-1.1.41}/tests/test_project_init.py +19 -5
  15. fastled-1.1.39/tests/test_api.py +0 -43
  16. {fastled-1.1.39 → fastled-1.1.41}/.aiderignore +0 -0
  17. {fastled-1.1.39 → fastled-1.1.41}/.github/workflows/build_multi_docker_image.yml +0 -0
  18. {fastled-1.1.39 → fastled-1.1.41}/.github/workflows/lint.yml +0 -0
  19. {fastled-1.1.39 → fastled-1.1.41}/.github/workflows/test_macos.yml +0 -0
  20. {fastled-1.1.39 → fastled-1.1.41}/.github/workflows/test_ubuntu.yml +0 -0
  21. {fastled-1.1.39 → fastled-1.1.41}/.github/workflows/test_win.yml +0 -0
  22. {fastled-1.1.39 → fastled-1.1.41}/.gitignore +0 -0
  23. {fastled-1.1.39 → fastled-1.1.41}/.pylintrc +0 -0
  24. {fastled-1.1.39 → fastled-1.1.41}/.vscode/launch.json +0 -0
  25. {fastled-1.1.39 → fastled-1.1.41}/.vscode/settings.json +0 -0
  26. {fastled-1.1.39 → fastled-1.1.41}/.vscode/tasks.json +0 -0
  27. {fastled-1.1.39 → fastled-1.1.41}/LICENSE +0 -0
  28. {fastled-1.1.39 → fastled-1.1.41}/MANIFEST.in +0 -0
  29. {fastled-1.1.39 → fastled-1.1.41}/clean +0 -0
  30. {fastled-1.1.39 → fastled-1.1.41}/docs/fastled.js +0 -0
  31. {fastled-1.1.39 → fastled-1.1.41}/docs/fastled.wasm +0 -0
  32. {fastled-1.1.39 → fastled-1.1.41}/docs/index.css +0 -0
  33. {fastled-1.1.39 → fastled-1.1.41}/docs/index.html +0 -0
  34. {fastled-1.1.39 → fastled-1.1.41}/docs/index.js +0 -0
  35. {fastled-1.1.39 → fastled-1.1.41}/examples/Blink/Blink.ino +0 -0
  36. {fastled-1.1.39 → fastled-1.1.41}/examples/Chromancer/Chromancer.ino +0 -0
  37. {fastled-1.1.39 → fastled-1.1.41}/examples/Chromancer/detail.h +0 -0
  38. {fastled-1.1.39 → fastled-1.1.41}/examples/Chromancer/gary_woos_wled_port/gary_woos_wled_ledmap.h +0 -0
  39. {fastled-1.1.39 → fastled-1.1.41}/examples/Chromancer/gary_woos_wled_port/presets.json +0 -0
  40. {fastled-1.1.39 → fastled-1.1.41}/examples/Chromancer/gary_woos_wled_port/presets.min.json +0 -0
  41. {fastled-1.1.39 → fastled-1.1.41}/examples/Chromancer/gen.py +0 -0
  42. {fastled-1.1.39 → fastled-1.1.41}/examples/Chromancer/mapping.h +0 -0
  43. {fastled-1.1.39 → fastled-1.1.41}/examples/Chromancer/net.h +0 -0
  44. {fastled-1.1.39 → fastled-1.1.41}/examples/Chromancer/output.json +0 -0
  45. {fastled-1.1.39 → fastled-1.1.41}/examples/Chromancer/ripple.h +0 -0
  46. {fastled-1.1.39 → fastled-1.1.41}/examples/Chromancer/screenmap.json.h +0 -0
  47. {fastled-1.1.39 → fastled-1.1.41}/examples/ColorPalette/ColorPalette.ino +0 -0
  48. {fastled-1.1.39 → fastled-1.1.41}/examples/ColorTemperature/ColorTemperature.ino +0 -0
  49. {fastled-1.1.39 → fastled-1.1.41}/examples/Cylon/Cylon.ino +0 -0
  50. {fastled-1.1.39 → fastled-1.1.41}/examples/DemoReel100/DemoReel100.ino +0 -0
  51. {fastled-1.1.39 → fastled-1.1.41}/examples/Esp32Rmt51/Esp32Rmt51.ino +0 -0
  52. {fastled-1.1.39 → fastled-1.1.41}/examples/EspI2SDemo/EspI2SDemo.ino +0 -0
  53. {fastled-1.1.39 → fastled-1.1.41}/examples/Fire2012/Fire2012.ino +0 -0
  54. {fastled-1.1.39 → fastled-1.1.41}/examples/Fire2012WithPalette/Fire2012WithPalette.ino +0 -0
  55. {fastled-1.1.39 → fastled-1.1.41}/examples/FirstLight/FirstLight.ino +0 -0
  56. {fastled-1.1.39 → fastled-1.1.41}/examples/FxEngine/FxEngine.ino +0 -0
  57. {fastled-1.1.39 → fastled-1.1.41}/examples/Noise/Noise.ino +0 -0
  58. {fastled-1.1.39 → fastled-1.1.41}/examples/NoisePlayground/NoisePlayground.ino +0 -0
  59. {fastled-1.1.39 → fastled-1.1.41}/examples/NoisePlusPalette/NoisePlusPalette.ino +0 -0
  60. {fastled-1.1.39 → fastled-1.1.41}/examples/OctoWS2811/OctoWS2811.ino +0 -0
  61. {fastled-1.1.39 → fastled-1.1.41}/examples/Pacifica/Pacifica.ino +0 -0
  62. {fastled-1.1.39 → fastled-1.1.41}/examples/Pride2015/Pride2015.ino +0 -0
  63. {fastled-1.1.39 → fastled-1.1.41}/examples/TwinkleFox/TwinkleFox.ino +0 -0
  64. {fastled-1.1.39 → fastled-1.1.41}/examples/Video/Gfx2Video/Gfx2Video.ino +0 -0
  65. {fastled-1.1.39 → fastled-1.1.41}/examples/WasmScreenCoords/WasmScreenCoords.ino +0 -0
  66. {fastled-1.1.39 → fastled-1.1.41}/examples/Water/Water.ino +0 -0
  67. {fastled-1.1.39 → fastled-1.1.41}/examples/XYMatrix/XYMatrix.ino +0 -0
  68. {fastled-1.1.39 → fastled-1.1.41}/examples/wasm/wasm.ino +0 -0
  69. {fastled-1.1.39 → fastled-1.1.41}/install +0 -0
  70. {fastled-1.1.39 → fastled-1.1.41}/pyproject.toml +0 -0
  71. {fastled-1.1.39 → fastled-1.1.41}/setup.cfg +0 -0
  72. {fastled-1.1.39 → fastled-1.1.41}/setup.py +0 -0
  73. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/app.py +0 -0
  74. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/assets/example.txt +0 -0
  75. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/cli.py +0 -0
  76. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/compile_server.py +0 -0
  77. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/compile_server_impl.py +0 -0
  78. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/docker_manager.py +0 -0
  79. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/filewatcher.py +0 -0
  80. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/keyboard.py +0 -0
  81. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/live_client.py +0 -0
  82. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/open_browser.py +0 -0
  83. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/paths.py +0 -0
  84. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/select_sketch_directory.py +0 -0
  85. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/settings.py +0 -0
  86. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/sketch.py +0 -0
  87. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/spinner.py +0 -0
  88. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/string_diff.py +0 -0
  89. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/test/examples.py +0 -0
  90. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/types.py +0 -0
  91. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/util.py +0 -0
  92. {fastled-1.1.39 → fastled-1.1.41}/src/fastled/web_compile.py +0 -0
  93. {fastled-1.1.39 → fastled-1.1.41}/src/fastled.egg-info/dependency_links.txt +0 -0
  94. {fastled-1.1.39 → fastled-1.1.41}/src/fastled.egg-info/entry_points.txt +0 -0
  95. {fastled-1.1.39 → fastled-1.1.41}/src/fastled.egg-info/requires.txt +0 -0
  96. {fastled-1.1.39 → fastled-1.1.41}/src/fastled.egg-info/top_level.txt +0 -0
  97. {fastled-1.1.39 → fastled-1.1.41}/tests/test_bad_ino.py +0 -0
  98. {fastled-1.1.39 → fastled-1.1.41}/tests/test_cli.py +0 -0
  99. {fastled-1.1.39 → fastled-1.1.41}/tests/test_compile_server.py +0 -0
  100. {fastled-1.1.39 → fastled-1.1.41}/tests/test_docker_linux_on_windows.py +0 -0
  101. {fastled-1.1.39 → fastled-1.1.41}/tests/test_embedded_data.py +0 -0
  102. {fastled-1.1.39 → fastled-1.1.41}/tests/test_examples.py +0 -0
  103. {fastled-1.1.39 → fastled-1.1.41}/tests/test_filechanger.py +0 -0
  104. {fastled-1.1.39 → fastled-1.1.41}/tests/test_ino/bad/bad.ino +0 -0
  105. {fastled-1.1.39 → fastled-1.1.41}/tests/test_ino/embedded/data/bigdata.dat +0 -0
  106. {fastled-1.1.39 → fastled-1.1.41}/tests/test_ino/embedded/wasm.ino +0 -0
  107. {fastled-1.1.39 → fastled-1.1.41}/tests/test_ino/wasm/wasm.ino +0 -0
  108. {fastled-1.1.39 → fastled-1.1.41}/tests/test_server_and_client_seperatly.py +0 -0
  109. {fastled-1.1.39 → fastled-1.1.41}/tests/test_webcompile.py +0 -0
  110. {fastled-1.1.39 → fastled-1.1.41}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.1.39
3
+ Version: 1.1.41
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -27,11 +27,14 @@ Compiles an Arduino/Platformio sketch into a wasm binary that can be run directl
27
27
 
28
28
 
29
29
  [![Linting](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml)
30
- [![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)
31
30
  [![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)
32
31
  [![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)
33
32
  [![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)
34
33
 
34
+ [![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)
35
+ [![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)
36
+ [![Create Version Tag](https://github.com/zackees/fastled-wasm/actions/workflows/create_version_tag.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/create_version_tag.yml)
37
+ [![Build and Publish Release](https://github.com/zackees/fastled-wasm/actions/workflows/build_release.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_release.yml)
35
38
 
36
39
 
37
40
  # About
@@ -254,8 +257,11 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
254
257
  Q: How can I get the compiled size of my FastLED sketch smaller?
255
258
  A: A big chunk of space is being used by unnecessary javascript `emscripten` is bundling. This can be tweeked by the wasm_compiler_settings.py file in the FastLED repo.
256
259
 
260
+
257
261
  # Revisions
258
262
 
263
+ * 1.1.41 - Platform executable (through pyinstaller) now enabled.
264
+ * 1.1.40 - Remove `sketch_directory` from Api object. This was only needed before we had a client/server architecture.
259
265
  * 1.1.39 - Added `LiveClient`, `fastled.Api.live_server()` will spawn it. Allows user to have a live compiling client that re-triggers a compile on file changes.
260
266
  * 1.1.38 - Cleanup the `fastled.Api` object and streamline for general use.
261
267
  * 1.1.37 - `Test.test_examples()` is now unit tested to work correctly.
@@ -4,11 +4,14 @@ Compiles an Arduino/Platformio sketch into a wasm binary that can be run directl
4
4
 
5
5
 
6
6
  [![Linting](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml)
7
- [![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)
8
7
  [![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)
9
8
  [![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)
10
9
  [![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)
11
10
 
11
+ [![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)
12
+ [![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)
13
+ [![Create Version Tag](https://github.com/zackees/fastled-wasm/actions/workflows/create_version_tag.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/create_version_tag.yml)
14
+ [![Build and Publish Release](https://github.com/zackees/fastled-wasm/actions/workflows/build_release.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_release.yml)
12
15
 
13
16
 
14
17
  # About
@@ -231,8 +234,11 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
231
234
  Q: How can I get the compiled size of my FastLED sketch smaller?
232
235
  A: A big chunk of space is being used by unnecessary javascript `emscripten` is bundling. This can be tweeked by the wasm_compiler_settings.py file in the FastLED repo.
233
236
 
237
+
234
238
  # Revisions
235
239
 
240
+ * 1.1.41 - Platform executable (through pyinstaller) now enabled.
241
+ * 1.1.40 - Remove `sketch_directory` from Api object. This was only needed before we had a client/server architecture.
236
242
  * 1.1.39 - Added `LiveClient`, `fastled.Api.live_server()` will spawn it. Allows user to have a live compiling client that re-triggers a compile on file changes.
237
243
  * 1.1.38 - Cleanup the `fastled.Api` object and streamline for general use.
238
244
  * 1.1.37 - `Test.test_examples()` is now unit tested to work correctly.
@@ -0,0 +1,48 @@
1
+ #!/usr/bin/env python3
2
+ import subprocess
3
+ import sys
4
+ import os
5
+
6
+ from pathlib import Path
7
+
8
+ HERE = Path(__file__).parent
9
+
10
+ def check_pyinstaller():
11
+ """Check if pyinstaller is installed, install if not."""
12
+ try:
13
+ subprocess.run([sys.executable, "-m", "pip", "show", "pyinstaller"],
14
+ check=True, capture_output=True)
15
+ except subprocess.CalledProcessError:
16
+ print("Installing pyinstaller...")
17
+ subprocess.run([sys.executable, "-m", "pip", "install", "pyinstaller"],
18
+ check=True)
19
+
20
+ def main():
21
+ os.chdir(str(HERE))
22
+ # Activate virtual environment if needed
23
+ # Note: This is typically handled by the Python interpreter itself
24
+ # when running the script from the correct environment
25
+
26
+ # Check and install pyinstaller if needed
27
+ check_pyinstaller()
28
+
29
+ # Run pyinstaller with the same arguments as the bash script
30
+ cmd = [
31
+ "pyinstaller",
32
+ "src/fastled/app.py",
33
+ "--onefile",
34
+ "--clean",
35
+ "--argv-emulation",
36
+ "--name", "fastled",
37
+ #"--target-architecture", "universal2"
38
+ ]
39
+
40
+ try:
41
+ subprocess.run(cmd, check=True)
42
+ except subprocess.CalledProcessError as e:
43
+ print(f"Error running pyinstaller: {e}")
44
+ return 1
45
+ return 0
46
+
47
+ if __name__ == "__main__":
48
+ sys.exit(main())
@@ -1,15 +1,17 @@
1
1
  #!/bin/bash
2
2
  set -e
3
3
 
4
+ . ./activate
5
+
4
6
  echo Running ruff src
5
- uv run ruff check --fix src
7
+ ruff check --fix src
6
8
  echo Running ruff tests
7
- uv run ruff check --fix tests
9
+ ruff check --fix tests
8
10
  echo Running black src tests
9
- uv run black src tests
11
+ black src tests
10
12
  echo Running isort src tests
11
- uv run isort --profile black src tests
13
+ isort --profile black src tests
12
14
  echo Running mypy src
13
- uv run mypy src tests
15
+ mypy src tests
14
16
  echo Linting complete!
15
17
  exit 0
@@ -4,3 +4,4 @@ mypy
4
4
  pytest
5
5
  ruff
6
6
  pytest-xdist
7
+ pyinstaller
@@ -9,7 +9,7 @@ from .compile_server import CompileServer
9
9
  from .live_client import LiveClient
10
10
  from .types import BuildMode, CompileResult, CompileServerError
11
11
 
12
- __version__ = "1.1.39"
12
+ __version__ = "1.1.41"
13
13
 
14
14
 
15
15
  class Api:
@@ -69,7 +69,6 @@ class Api:
69
69
 
70
70
  @staticmethod
71
71
  def spawn_server(
72
- sketch_directory: Path | None = None,
73
72
  interactive=False,
74
73
  auto_updates=None,
75
74
  auto_start=True,
@@ -81,7 +80,7 @@ class Api:
81
80
  container_name=container_name,
82
81
  interactive=interactive,
83
82
  auto_updates=auto_updates,
84
- mapped_dir=sketch_directory,
83
+ mapped_dir=None,
85
84
  auto_start=auto_start,
86
85
  )
87
86
  return out
@@ -89,14 +88,12 @@ class Api:
89
88
  @staticmethod
90
89
  @contextmanager
91
90
  def server(
92
- sketch_directory: Path | None = None,
93
91
  interactive=False,
94
92
  auto_updates=None,
95
93
  auto_start=True,
96
94
  container_name: str | None = None,
97
95
  ) -> Generator[CompileServer, None, None]:
98
96
  server = Api.spawn_server(
99
- sketch_directory=sketch_directory,
100
97
  interactive=interactive,
101
98
  auto_updates=auto_updates,
102
99
  auto_start=auto_start,
@@ -22,6 +22,11 @@ from fastled.web_compile import (
22
22
  )
23
23
 
24
24
 
25
+ # Override this function in your own code to run tests before compilation
26
+ def TEST_BEFORE_COMPILE(url) -> None:
27
+ pass
28
+
29
+
25
30
  def _run_web_compiler(
26
31
  directory: Path,
27
32
  host: str,
@@ -153,6 +158,7 @@ def run_client(
153
158
  profile: bool = profile,
154
159
  last_hash_value: str | None = None,
155
160
  ) -> CompileResult:
161
+ TEST_BEFORE_COMPILE(url)
156
162
  return _run_web_compiler(
157
163
  directory,
158
164
  host=url,
@@ -19,7 +19,7 @@ def parse_args() -> argparse.Namespace:
19
19
  """Parse command-line arguments."""
20
20
  parser = argparse.ArgumentParser(description=f"FastLED WASM Compiler {__version__}")
21
21
  parser.add_argument(
22
- "--version", action="version", version=f"%(prog)s {__version__}"
22
+ "--version", action="version", version=f"{__version__}"
23
23
  )
24
24
  parser.add_argument(
25
25
  "directory",
@@ -13,7 +13,8 @@ DEFAULT_EXAMPLE = "wasm"
13
13
  def get_examples() -> list[str]:
14
14
  response = httpx.get(ENDPOINT_INFO, timeout=4)
15
15
  response.raise_for_status()
16
- return response.json()["examples"]
16
+ out: list[str] = response.json()["examples"]
17
+ return sorted(out)
17
18
 
18
19
 
19
20
  def _prompt_for_example() -> str:
@@ -62,7 +63,9 @@ def project_init(
62
63
  with zipfile.ZipFile(tmpzip, "r") as zip_ref:
63
64
  zip_ref.extractall(outputdir)
64
65
  tmpzip.unlink()
65
- return outputdir.iterdir().__next__()
66
+ out = outputdir / example
67
+ assert out.exists()
68
+ return out
66
69
 
67
70
 
68
71
  def unit_test() -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.1.39
3
+ Version: 1.1.41
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -27,11 +27,14 @@ Compiles an Arduino/Platformio sketch into a wasm binary that can be run directl
27
27
 
28
28
 
29
29
  [![Linting](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/lint.yml)
30
- [![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)
31
30
  [![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)
32
31
  [![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)
33
32
  [![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)
34
33
 
34
+ [![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)
35
+ [![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)
36
+ [![Create Version Tag](https://github.com/zackees/fastled-wasm/actions/workflows/create_version_tag.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/create_version_tag.yml)
37
+ [![Build and Publish Release](https://github.com/zackees/fastled-wasm/actions/workflows/build_release.yml/badge.svg)](https://github.com/zackees/fastled-wasm/actions/workflows/build_release.yml)
35
38
 
36
39
 
37
40
  # About
@@ -254,8 +257,11 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
254
257
  Q: How can I get the compiled size of my FastLED sketch smaller?
255
258
  A: A big chunk of space is being used by unnecessary javascript `emscripten` is bundling. This can be tweeked by the wasm_compiler_settings.py file in the FastLED repo.
256
259
 
260
+
257
261
  # Revisions
258
262
 
263
+ * 1.1.41 - Platform executable (through pyinstaller) now enabled.
264
+ * 1.1.40 - Remove `sketch_directory` from Api object. This was only needed before we had a client/server architecture.
259
265
  * 1.1.39 - Added `LiveClient`, `fastled.Api.live_server()` will spawn it. Allows user to have a live compiling client that re-triggers a compile on file changes.
260
266
  * 1.1.38 - Cleanup the `fastled.Api` object and streamline for general use.
261
267
  * 1.1.37 - `Test.test_examples()` is now unit tested to work correctly.
@@ -4,6 +4,7 @@
4
4
  LICENSE
5
5
  MANIFEST.in
6
6
  README.md
7
+ build_exe.py
7
8
  clean
8
9
  install
9
10
  lint
@@ -1,9 +1,9 @@
1
1
  #!/bin/bash
2
2
 
3
3
  set -e
4
-
5
4
  # Can't run in parralel because of the shared docker
6
5
  # instance.
7
- uv run pytest -s -vv tests "$@"
6
+ . ./activate
7
+ pytest -v -s tests "$@"
8
8
  # uv run pytest -n auto tests -v
9
9
 
@@ -0,0 +1,62 @@
1
+ """
2
+ Unit test file.
3
+ """
4
+
5
+ import os
6
+ import platform
7
+ import unittest
8
+ from tempfile import TemporaryDirectory
9
+
10
+ from fastled import Api, CompileServer, LiveClient
11
+
12
+ # def override(url) -> None:
13
+ # """Override the server url."""
14
+ # assert isinstance(url, str) and "localhost" in url
15
+
16
+ # client_server.TEST_BEFORE_COMPILE = override
17
+
18
+
19
+ def _enabled() -> bool:
20
+ """Check if this system can run the tests."""
21
+ is_github_runner = "GITHUB_ACTIONS" in os.environ
22
+ if not is_github_runner:
23
+ return True
24
+ # this only works in ubuntu at the moment
25
+ return platform.system() == "Linux"
26
+
27
+
28
+ class ApiTester(unittest.TestCase):
29
+ """Main tester class."""
30
+
31
+ # @unittest.skipUnless(_enabled(), "This test takes a long time.")
32
+ # def test_examples(self) -> None:
33
+ # """Test command line interface (CLI)."""
34
+
35
+ # with Api.server() as server:
36
+ # out = Test.test_examples(host=server)
37
+ # self.assertEqual(0, len(out), f"Failed tests: {out}")
38
+
39
+ @unittest.skipUnless(_enabled(), "Can only happen with a local server.")
40
+ def test_live_client(self) -> None:
41
+ """Tests that a project can be init'd, then compiled using a local server."""
42
+
43
+ with TemporaryDirectory() as tmpdir:
44
+ with Api.server() as server:
45
+ assert isinstance(server, CompileServer)
46
+ sketch_directory = Api.project_init(
47
+ example="Blink", outputdir=tmpdir, host=server
48
+ )
49
+ client = LiveClient(
50
+ sketch_directory=sketch_directory,
51
+ open_web_browser=False,
52
+ host=server,
53
+ keep_running=False,
54
+ )
55
+ client.stop()
56
+ expected_output_dir = sketch_directory / "fastled_js"
57
+ # now test that fastled_js is in the sketch directory
58
+ self.assertTrue(expected_output_dir.exists())
59
+
60
+
61
+ if __name__ == "__main__":
62
+ unittest.main()
@@ -1,13 +1,25 @@
1
+ import os
2
+ import platform
1
3
  import unittest
2
4
  from pathlib import Path
3
5
  from tempfile import TemporaryDirectory
4
6
 
7
+ from fastled import Api
5
8
  from fastled.project_init import get_examples, project_init
6
9
 
7
10
  HERE = Path(__file__).parent
8
11
  TEST_DIR = HERE / "test_ino" / "wasm"
9
12
 
10
13
 
14
+ def _enabled() -> bool:
15
+ """Check if this system can run the tests."""
16
+ is_github_runner = "GITHUB_ACTIONS" in os.environ
17
+ if not is_github_runner:
18
+ return True
19
+ # this only works in ubuntu at the moment
20
+ return platform.system() == "Linux"
21
+
22
+
11
23
  class ProjectInitTester(unittest.TestCase):
12
24
  """Main tester class."""
13
25
 
@@ -17,16 +29,18 @@ class ProjectInitTester(unittest.TestCase):
17
29
  self.assertTrue(len(examples) > 0)
18
30
  self.assertTrue("wasm" in examples)
19
31
 
32
+ @unittest.skipUnless(_enabled(), "This is not a fast test")
20
33
  def test_compile(self) -> None:
21
34
  """Test web compilation functionality with real server."""
22
35
  # Test the web_compile function with actual server call
23
36
  with TemporaryDirectory() as tmpdir:
24
37
  out = Path(tmpdir)
25
- project_init(example="wasm", outputdir=out)
26
- # print out everything in the out dir
27
- for f in out.iterdir():
28
- print(f)
29
- self.assertTrue((out / "wasm" / "wasm.ino").exists())
38
+ with Api.server() as server:
39
+ project_init(example="wasm", outputdir=out, host=server.url())
40
+ # print out everything in the out dir
41
+ for f in out.iterdir():
42
+ print(f)
43
+ self.assertTrue((out / "wasm" / "wasm.ino").exists())
30
44
 
31
45
 
32
46
  if __name__ == "__main__":
@@ -1,43 +0,0 @@
1
- """
2
- Unit test file.
3
- """
4
-
5
- import unittest
6
- from tempfile import TemporaryDirectory
7
-
8
- from fastled import Api, LiveClient, Test
9
-
10
- ENABLED = False
11
-
12
-
13
- class ApiTester(unittest.TestCase):
14
- """Main tester class."""
15
-
16
- @unittest.skipUnless(ENABLED, "This test takes a long time.")
17
- def test_examples(self) -> None:
18
- """Test command line interface (CLI)."""
19
-
20
- with Api.server() as server:
21
- out = Test.test_examples(host=server)
22
- self.assertEqual(0, len(out), f"Failed tests: {out}")
23
-
24
- def test_live_client(self) -> None:
25
- """Test command line interface (CLI)."""
26
-
27
- with TemporaryDirectory() as tmpdir:
28
- with Api.server() as server:
29
- sketch_directory = Api.project_init(example="Blink", outputdir=tmpdir)
30
- client = LiveClient(
31
- sketch_directory=sketch_directory,
32
- open_web_browser=False,
33
- host=server,
34
- keep_running=False,
35
- )
36
- client.stop()
37
- expected_output_dir = sketch_directory / "fastled_js"
38
- # now test that fastled_js is in the sketch directory
39
- self.assertTrue(expected_output_dir.exists())
40
-
41
-
42
- if __name__ == "__main__":
43
- unittest.main()
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