fastled 1.3.18__tar.gz → 1.3.22__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 (117) hide show
  1. {fastled-1.3.18 → fastled-1.3.22}/Dockerfile +6 -8
  2. {fastled-1.3.18 → fastled-1.3.22}/PKG-INFO +34 -8
  3. {fastled-1.3.18 → fastled-1.3.22}/README.md +33 -7
  4. {fastled-1.3.18 → fastled-1.3.22}/install +3 -4
  5. fastled-1.3.22/requirements.docker.txt +1 -0
  6. {fastled-1.3.18 → fastled-1.3.22}/requirements.testing.txt +0 -1
  7. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/__version__.py +1 -1
  8. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/client_server.py +1 -1
  9. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/server_flask.py +25 -76
  10. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/util.py +2 -1
  11. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/web_compile.py +1 -1
  12. {fastled-1.3.18 → fastled-1.3.22}/src/fastled.egg-info/PKG-INFO +34 -8
  13. {fastled-1.3.18 → fastled-1.3.22}/src/fastled.egg-info/SOURCES.txt +1 -0
  14. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_banner_string.py +2 -2
  15. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_debug_fetch_source_files.py +30 -17
  16. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_http_server.py +3 -0
  17. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_ino/bad_platformio/platformio.ini +1 -1
  18. {fastled-1.3.18 → fastled-1.3.22}/.aiderignore +0 -0
  19. {fastled-1.3.18 → fastled-1.3.22}/.dockerignore +0 -0
  20. {fastled-1.3.18 → fastled-1.3.22}/.github/workflows/build_multi_docker_image.yml +0 -0
  21. {fastled-1.3.18 → fastled-1.3.22}/.github/workflows/build_webpage.yml +0 -0
  22. {fastled-1.3.18 → fastled-1.3.22}/.github/workflows/lint.yml +0 -0
  23. {fastled-1.3.18 → fastled-1.3.22}/.github/workflows/publish_release.yml +0 -0
  24. {fastled-1.3.18 → fastled-1.3.22}/.github/workflows/template_build_docker_image.yml +0 -0
  25. {fastled-1.3.18 → fastled-1.3.22}/.github/workflows/test_build_exe.yml +0 -0
  26. {fastled-1.3.18 → fastled-1.3.22}/.github/workflows/test_macos.yml +0 -0
  27. {fastled-1.3.18 → fastled-1.3.22}/.github/workflows/test_ubuntu.yml +0 -0
  28. {fastled-1.3.18 → fastled-1.3.22}/.github/workflows/test_win.yml +0 -0
  29. {fastled-1.3.18 → fastled-1.3.22}/.gitignore +0 -0
  30. {fastled-1.3.18 → fastled-1.3.22}/.pylintrc +0 -0
  31. {fastled-1.3.18 → fastled-1.3.22}/.vscode/launch.json +0 -0
  32. {fastled-1.3.18 → fastled-1.3.22}/.vscode/settings.json +0 -0
  33. {fastled-1.3.18 → fastled-1.3.22}/.vscode/tasks.json +0 -0
  34. {fastled-1.3.18 → fastled-1.3.22}/DEBUGGER.md +0 -0
  35. {fastled-1.3.18 → fastled-1.3.22}/FAQ.md +0 -0
  36. {fastled-1.3.18 → fastled-1.3.22}/LICENSE +0 -0
  37. {fastled-1.3.18 → fastled-1.3.22}/MANIFEST.in +0 -0
  38. {fastled-1.3.18 → fastled-1.3.22}/RELEASE.md +0 -0
  39. {fastled-1.3.18 → fastled-1.3.22}/TODO.md +0 -0
  40. {fastled-1.3.18 → fastled-1.3.22}/build_exe.py +0 -0
  41. {fastled-1.3.18 → fastled-1.3.22}/build_local_docker.py +0 -0
  42. {fastled-1.3.18 → fastled-1.3.22}/build_site.py +0 -0
  43. {fastled-1.3.18 → fastled-1.3.22}/clean +0 -0
  44. {fastled-1.3.18 → fastled-1.3.22}/compiler/debug.sh +0 -0
  45. {fastled-1.3.18 → fastled-1.3.22}/compiler/run.py +0 -0
  46. {fastled-1.3.18 → fastled-1.3.22}/demo/100dots.html +0 -0
  47. {fastled-1.3.18 → fastled-1.3.22}/demo/demo_threejs.html +0 -0
  48. {fastled-1.3.18 → fastled-1.3.22}/demo/micdemo.html +0 -0
  49. {fastled-1.3.18 → fastled-1.3.22}/demo/mp3upload.html +0 -0
  50. {fastled-1.3.18 → fastled-1.3.22}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
  51. {fastled-1.3.18 → fastled-1.3.22}/docker-compose.yml +0 -0
  52. {fastled-1.3.18 → fastled-1.3.22}/entrypoint.sh +0 -0
  53. {fastled-1.3.18 → fastled-1.3.22}/install_linux.sh +0 -0
  54. {fastled-1.3.18 → fastled-1.3.22}/lint +0 -0
  55. {fastled-1.3.18 → fastled-1.3.22}/pyproject.toml +0 -0
  56. {fastled-1.3.18 → fastled-1.3.22}/setup.cfg +0 -0
  57. {fastled-1.3.18 → fastled-1.3.22}/setup.py +0 -0
  58. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/__init__.py +0 -0
  59. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/app.py +0 -0
  60. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/args.py +0 -0
  61. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/assets/example.txt +0 -0
  62. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/assets/localhost-key.pem +0 -0
  63. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/assets/localhost.pem +0 -0
  64. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/cli.py +0 -0
  65. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/cli_test.py +0 -0
  66. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/cli_test_interactive.py +0 -0
  67. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/compile_server.py +0 -0
  68. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/compile_server_impl.py +0 -0
  69. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/docker_manager.py +0 -0
  70. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/filewatcher.py +0 -0
  71. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/keyboard.py +0 -0
  72. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/keyz.py +0 -0
  73. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/live_client.py +0 -0
  74. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/open_browser.py +0 -0
  75. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/parse_args.py +0 -0
  76. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/paths.py +0 -0
  77. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/print_filter.py +0 -0
  78. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/project_init.py +0 -0
  79. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/select_sketch_directory.py +0 -0
  80. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/server_start.py +0 -0
  81. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/settings.py +0 -0
  82. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/site/build.py +0 -0
  83. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/site/examples.py +0 -0
  84. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/sketch.py +0 -0
  85. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/spinner.py +0 -0
  86. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/string_diff.py +0 -0
  87. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  88. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/test/examples.py +0 -0
  89. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/types.py +0 -0
  90. {fastled-1.3.18 → fastled-1.3.22}/src/fastled/version.py +0 -0
  91. {fastled-1.3.18 → fastled-1.3.22}/src/fastled.egg-info/dependency_links.txt +0 -0
  92. {fastled-1.3.18 → fastled-1.3.22}/src/fastled.egg-info/entry_points.txt +0 -0
  93. {fastled-1.3.18 → fastled-1.3.22}/src/fastled.egg-info/requires.txt +0 -0
  94. {fastled-1.3.18 → fastled-1.3.22}/src/fastled.egg-info/top_level.txt +0 -0
  95. {fastled-1.3.18 → fastled-1.3.22}/test +0 -0
  96. {fastled-1.3.18 → fastled-1.3.22}/tests/integration/test_build_examples.py +0 -0
  97. {fastled-1.3.18 → fastled-1.3.22}/tests/integration/test_examples.py +0 -0
  98. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/html/index.html +0 -0
  99. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_api.py +0 -0
  100. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_bad_ino.py +0 -0
  101. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_cli.py +0 -0
  102. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_compile_server.py +0 -0
  103. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_docker_linux_on_windows.py +0 -0
  104. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_embedded_data.py +0 -0
  105. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_filechanger.py +0 -0
  106. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_ino/bad/bad.ino +0 -0
  107. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
  108. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
  109. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_ino/embedded/wasm.ino +0 -0
  110. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_ino/wasm/wasm.ino +0 -0
  111. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_project_init.py +0 -0
  112. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_server_and_client_seperatly.py +0 -0
  113. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_string_diff.py +0 -0
  114. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_version.py +0 -0
  115. {fastled-1.3.18 → fastled-1.3.22}/tests/unit/test_webcompile.py +0 -0
  116. {fastled-1.3.18 → fastled-1.3.22}/upload_package.sh +0 -0
  117. {fastled-1.3.18 → fastled-1.3.22}/vscode-plugin/readme +0 -0
@@ -3,14 +3,12 @@
3
3
  FROM niteris/fastled-wasm-compiler:latest
4
4
 
5
5
 
6
- COPY requirements.testing.txt /install/requirements.txt
7
- # Extract fastled-wasm-server version from requirements.txt
8
- RUN \
9
- grep -oP '(?<=fastled-wasm-server[<>=!]=?)[^ \n#]+' /install/requirements.txt > /install/version.txt && \
10
- cat /install/version.txt > /install/requirements.txt && \
11
- uv pip install --system -r /install/requirements.txt --refresh || \
12
- uv pip install --system -r /install/requirements.txt --refresh || \
13
- uv pip install --system -r /install/requirements.txt --refresh
6
+ COPY requirements.docker.txt /install/requirements.docker.txt
7
+
8
+ # Fresh packages need multiple hits to bust through stale cache... and this is fast.
9
+ RUN uv pip install --system -r /install/requirements.docker.txt --refresh || \
10
+ uv pip install --system -r /install/requirements.docker.txt --refresh || \
11
+ uv pip install --system -r /install/requirements.docker.txt --refresh
14
12
 
15
13
  # FIRST PRE-WARM CYCLE and initial setup: Download the fastled repo from the github and pre-warm the cache with a compilation.
16
14
  # This is by far the most expensive part of the build, because platformio needs to download initial tools. This
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.3.18
3
+ Version: 1.3.22
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -57,12 +57,44 @@ If you have docker installed, the compiler will download the docker image and ru
57
57
 
58
58
  In every conceivable way, the local compiler will be much faster than the web version.
59
59
 
60
+ # Run
61
+
62
+ Once `fastled` is installed you'll just navigate to your sketch directory and run it.
63
+
64
+ Example:
65
+
66
+ ```bash
67
+ $ cd mysketchdirectory
68
+ $ fastled
69
+ ```
70
+
60
71
 
61
72
  # Install
62
73
 
74
+ This is a python app, so any python package manager will work. We also provide python compiled binaries for Windows, MacOS, and Linux.
75
+
76
+ ### Pip
77
+
63
78
  `pip install fastled`
64
79
 
65
- ### Ubuntu Binaries
80
+ ### UV
81
+
82
+ `uv pip install fastled --system`
83
+
84
+ ### Pipx
85
+
86
+ `pipx install fastled`
87
+
88
+ ### Executables
89
+
90
+ * Windows: https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-windows-x64.zip
91
+ * MacOS (M1+): https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-macos-arm64.zip
92
+ * MacOS (x86): https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-macos-x64.zip
93
+ * Linux (x86): https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-linux-x64.zip
94
+
95
+
96
+
97
+ ### Ubuntu Install Script
66
98
 
67
99
  You can get the latest ubuntu binary of the FastLED cli compiler like this:
68
100
 
@@ -70,12 +102,6 @@ You can get the latest ubuntu binary of the FastLED cli compiler like this:
70
102
  curl -L https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/install_linux.sh | /bin/bash
71
103
  ```
72
104
 
73
- # Run
74
-
75
- ```bash
76
- cd mysketchdirectory
77
- fastled
78
- ```
79
105
 
80
106
  # Tutorial video
81
107
 
@@ -30,12 +30,44 @@ If you have docker installed, the compiler will download the docker image and ru
30
30
 
31
31
  In every conceivable way, the local compiler will be much faster than the web version.
32
32
 
33
+ # Run
34
+
35
+ Once `fastled` is installed you'll just navigate to your sketch directory and run it.
36
+
37
+ Example:
38
+
39
+ ```bash
40
+ $ cd mysketchdirectory
41
+ $ fastled
42
+ ```
43
+
33
44
 
34
45
  # Install
35
46
 
47
+ This is a python app, so any python package manager will work. We also provide python compiled binaries for Windows, MacOS, and Linux.
48
+
49
+ ### Pip
50
+
36
51
  `pip install fastled`
37
52
 
38
- ### Ubuntu Binaries
53
+ ### UV
54
+
55
+ `uv pip install fastled --system`
56
+
57
+ ### Pipx
58
+
59
+ `pipx install fastled`
60
+
61
+ ### Executables
62
+
63
+ * Windows: https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-windows-x64.zip
64
+ * MacOS (M1+): https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-macos-arm64.zip
65
+ * MacOS (x86): https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-macos-x64.zip
66
+ * Linux (x86): https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-linux-x64.zip
67
+
68
+
69
+
70
+ ### Ubuntu Install Script
39
71
 
40
72
  You can get the latest ubuntu binary of the FastLED cli compiler like this:
41
73
 
@@ -43,12 +75,6 @@ You can get the latest ubuntu binary of the FastLED cli compiler like this:
43
75
  curl -L https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/install_linux.sh | /bin/bash
44
76
  ```
45
77
 
46
- # Run
47
-
48
- ```bash
49
- cd mysketchdirectory
50
- fastled
51
- ```
52
78
 
53
79
  # Tutorial video
54
80
 
@@ -19,10 +19,9 @@ fi
19
19
  uv venv --python 3.11 --seed
20
20
  uv run pip install -e .
21
21
 
22
- # If requirements.testing.txt exists, then install it
23
- if [[ -f requirements.testing.txt ]]; then
24
- uv run pip install -r requirements.testing.txt
25
- fi
22
+ uv run pip install -r requirements.testing.txt
23
+ uv run pip install -r requirements.docker.txt
24
+
26
25
 
27
26
  # If activate exists, delete it
28
27
  if [[ -f activate ]]; then
@@ -0,0 +1 @@
1
+ fastled-wasm-server>=1.0.74
@@ -6,4 +6,3 @@ ruff
6
6
  pytest-xdist
7
7
  pyinstaller
8
8
  pyright
9
- fastled-wasm-server>=1.0.70
@@ -1,6 +1,6 @@
1
1
  # IMPORTANT! There's a bug in github which will REJECT any version update
2
2
  # that has any other change in the repo. Please bump the version as the
3
3
  # ONLY change in a commit, or else the pypi update and the release will fail.
4
- __version__ = "1.3.18"
4
+ __version__ = "1.3.22"
5
5
 
6
6
  __version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
@@ -372,7 +372,7 @@ def run_client(
372
372
  if has_update:
373
373
  print(f"\n🔄 {message}")
374
374
  print(
375
- "Run with --auto-update to automatically update to the latest version."
375
+ "Run with `fastled -u` to update the docker image to the latest version."
376
376
  )
377
377
  except Exception as e:
378
378
  # Don't let Docker check failures interrupt the main flow
@@ -28,16 +28,19 @@ else:
28
28
 
29
29
  def _is_dwarf_source(path: str) -> bool:
30
30
  """Check if the path is a dwarf source file."""
31
+ logger.debug(f"_is_dwarf_source called with path: {path}")
31
32
  if "dwarfsource" in path:
32
33
  logger.debug(f"Path '{path}' contains 'dwarfsource'")
33
34
  return True
34
- # Check if the path starts with "fastledsource/" or "sketchsource/"
35
- return (
36
- path.startswith("fastledsource/")
37
- or path.startswith("sketchsource/")
38
- or path.startswith("/dwarfsource/")
39
- or path.startswith("dwarfsource/")
40
- )
35
+ _is_dwarf_source = False
36
+ for p in ["fastledsource", "sketchsource", "dwarfsource", "drawfsource"]:
37
+ if p in path:
38
+ _is_dwarf_source = True
39
+ logger.debug(f"Path '{p}' contains '{path}'")
40
+ break
41
+ if not _is_dwarf_source:
42
+ logger.debug(f"Path '{path}' is not a dwarf source file")
43
+ return _is_dwarf_source
41
44
 
42
45
 
43
46
  def _run_flask_server(
@@ -139,70 +142,15 @@ def _run_flask_server(
139
142
  logger.error(f"Error forwarding request: {e}", exc_info=True)
140
143
  return Response(f"Error: {str(e)}", status=500)
141
144
 
142
- def handle_fastledsource(path: str) -> Response:
143
- """Handle requests to
144
- /fastledsource/js/fastledsource/git/fastled/src/
145
- or
146
- /sketchsource/js/src/Blink.ino
147
-
148
- The names are a bit mangled due to the way C++ prefixing works near the root directory.
149
- """
150
- from flask import request
151
-
152
- start_time = time.time()
153
- logger.info(f"Processing request: {request.method} {request.url}")
154
- # Forward the request to the compile server
155
- target_url = f"http://localhost:{compile_server_port}/dwarfsource/{path}"
156
- logger.info(f"Requesting: {target_url}")
157
- logger.info(f"Processing dwarfsource request for {path}")
158
-
159
- # Log request headers
160
- request_headers = {
161
- key: value for key, value in request.headers if key != "Host"
162
- }
163
- logger.debug(f"Request headers: {request_headers}")
164
-
165
- try:
166
- # Forward the request with the same method, headers, and body
167
- with httpx.Client() as client:
168
- resp = client.request(
169
- method=request.method,
170
- url=target_url,
171
- headers=request_headers,
172
- content=request.get_data(),
173
- cookies=request.cookies,
174
- follow_redirects=True,
175
- )
176
-
177
- logger.info(f"Response status: {resp.status_code}")
178
- logger.debug(f"Response headers: {dict(resp.headers)}")
179
-
180
- # Create a Flask Response object from the httpx response
181
- payload = resp.content
182
- assert isinstance(payload, bytes)
183
-
184
- # Check if the payload is empty
185
- if len(payload) == 0:
186
- logger.error("Empty payload received from compile server")
187
- return Response("Empty payload", status=400)
188
-
189
- response = Response(
190
- payload, status=resp.status_code, headers=dict(resp.headers)
191
- )
192
-
193
- elapsed_time = time.time() - start_time
194
- logger.info(f"Request completed in {elapsed_time:.3f} seconds")
195
-
196
- return response
197
-
198
- except Exception as e:
199
- logger.error(f"Error handling dwarfsource request: {e}", exc_info=True)
200
- return Response(f"Error: {str(e)}", status=500)
201
-
202
- def handle_sourcefile(path: str) -> Response:
145
+ def handle_dwarfsource(path: str) -> Response:
203
146
  """Handle requests to /sourcefiles/*"""
204
147
  from flask import Response, request
205
148
 
149
+ # Request body should be
150
+ # {
151
+ # "path": "string"
152
+ # }
153
+
206
154
  start_time = time.time()
207
155
  logger.info("\n##################################")
208
156
  logger.info(f"# Serving source file /sourcefiles/ {path}")
@@ -211,7 +159,7 @@ def _run_flask_server(
211
159
  logger.info(f"Processing sourcefile request for {path}")
212
160
 
213
161
  # Forward the request to the compile server
214
- target_url = f"http://localhost:{compile_server_port}/{path}"
162
+ target_url = f"http://localhost:{compile_server_port}/dwarfsource"
215
163
  logger.info(f"Forwarding to: {target_url}")
216
164
 
217
165
  # Log request headers
@@ -220,14 +168,18 @@ def _run_flask_server(
220
168
  }
221
169
  logger.debug(f"Request headers: {request_headers}")
222
170
 
171
+ body: dict[str, str] = {
172
+ "path": path,
173
+ }
174
+
223
175
  try:
224
176
  # Forward the request with the same method, headers, and body
225
177
  with httpx.Client() as client:
226
178
  resp = client.request(
227
- method=request.method,
179
+ method="POST",
228
180
  url=target_url,
229
181
  headers=request_headers,
230
- content=request.get_data(),
182
+ json=body,
231
183
  cookies=request.cookies,
232
184
  follow_redirects=True,
233
185
  )
@@ -341,11 +293,8 @@ def _run_flask_server(
341
293
  is_debug_src_code_request = _is_dwarf_source(path)
342
294
  logger.info(f"is debug_src_code_request: {is_debug_src_code_request}")
343
295
  if is_debug_src_code_request:
344
- logger.info(f"Handling as drawfsource: {path}")
345
- return handle_fastledsource(path)
346
- elif path.startswith("sourcefiles/"):
347
- logger.info(f"Handling as sourcefiles: {path}")
348
- return handle_sourcefile(path)
296
+ logger.info(f"Handling as dwarf source file request: {path}")
297
+ return handle_dwarfsource(path)
349
298
  else:
350
299
  logger.info(f"Handling as local file: {path}")
351
300
  return handle_local_file_fetch(path)
@@ -19,7 +19,8 @@ def banner_string(msg: str) -> str:
19
19
  for line in lines:
20
20
  out.append(f"# {line} " + " " * (max_length - len(line)) + "#")
21
21
  out.append(border)
22
- return "\n".join(out)
22
+ outstr = "\n".join(out)
23
+ return f"\n{outstr}\n"
23
24
 
24
25
 
25
26
  def print_banner(msg: str) -> None:
@@ -182,7 +182,7 @@ def _banner(msg: str) -> str:
182
182
 
183
183
  # Add the bottom border
184
184
  banner += "#" * width + "\n"
185
- return banner
185
+ return f"\n{banner}\n"
186
186
 
187
187
 
188
188
  def _print_banner(msg: str) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.3.18
3
+ Version: 1.3.22
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -57,12 +57,44 @@ If you have docker installed, the compiler will download the docker image and ru
57
57
 
58
58
  In every conceivable way, the local compiler will be much faster than the web version.
59
59
 
60
+ # Run
61
+
62
+ Once `fastled` is installed you'll just navigate to your sketch directory and run it.
63
+
64
+ Example:
65
+
66
+ ```bash
67
+ $ cd mysketchdirectory
68
+ $ fastled
69
+ ```
70
+
60
71
 
61
72
  # Install
62
73
 
74
+ This is a python app, so any python package manager will work. We also provide python compiled binaries for Windows, MacOS, and Linux.
75
+
76
+ ### Pip
77
+
63
78
  `pip install fastled`
64
79
 
65
- ### Ubuntu Binaries
80
+ ### UV
81
+
82
+ `uv pip install fastled --system`
83
+
84
+ ### Pipx
85
+
86
+ `pipx install fastled`
87
+
88
+ ### Executables
89
+
90
+ * Windows: https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-windows-x64.zip
91
+ * MacOS (M1+): https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-macos-arm64.zip
92
+ * MacOS (x86): https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-macos-x64.zip
93
+ * Linux (x86): https://github.com/zackees/fastled-wasm/releases/latest/download/fastled-linux-x64.zip
94
+
95
+
96
+
97
+ ### Ubuntu Install Script
66
98
 
67
99
  You can get the latest ubuntu binary of the FastLED cli compiler like this:
68
100
 
@@ -70,12 +102,6 @@ You can get the latest ubuntu binary of the FastLED cli compiler like this:
70
102
  curl -L https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/install_linux.sh | /bin/bash
71
103
  ```
72
104
 
73
- # Run
74
-
75
- ```bash
76
- cd mysketchdirectory
77
- fastled
78
- ```
79
105
 
80
106
  # Tutorial video
81
107
 
@@ -20,6 +20,7 @@ install
20
20
  install_linux.sh
21
21
  lint
22
22
  pyproject.toml
23
+ requirements.docker.txt
23
24
  requirements.testing.txt
24
25
  setup.py
25
26
  test
@@ -5,10 +5,10 @@ from fastled.util import banner_string
5
5
  _MSG = "Hello, World!\nsecond line"
6
6
 
7
7
  _EXPECTED: str = (
8
- "#################\n"
8
+ "\n#################\n"
9
9
  "# Hello, World! #\n"
10
10
  "# second line #\n"
11
- "#################"
11
+ "#################\n"
12
12
  )
13
13
 
14
14
 
@@ -1,14 +1,14 @@
1
1
  import os
2
-
3
- os.environ["FLASK_SERVER_LOGGING"] = "1"
4
-
5
2
  import time
6
3
  import unittest
7
4
  import warnings
8
5
  from pathlib import Path
6
+ from urllib.parse import urlparse
9
7
 
10
8
  import httpx
11
9
 
10
+ os.environ["FLASK_SERVER_LOGGING"] = "1"
11
+
12
12
  from fastled import Api, LiveClient
13
13
 
14
14
  HERE = Path(__file__).parent
@@ -18,10 +18,13 @@ TEST_INO_WASM = HERE / "test_ino" / "wasm"
18
18
  _ENABLED = True
19
19
 
20
20
  _DWARF_SRC_EXAMPLE1 = "http://localhost:{http_port}/dwarfsource/fastledsource/js/src/fastledsource/git/fastled/src/FastLED.h"
21
-
21
+ _DWARF_SRC_EXAMPLE2 = (
22
+ "http://localhost:{http_port}/dwarfsource/js/dwarfsource/git/fastled/src/chipsets.h"
23
+ )
22
24
 
23
25
  _DWARF_SRC_EXAMPLES = [
24
- _DWARF_SRC_EXAMPLE1,
26
+ # _DWARF_SRC_EXAMPLE1,
27
+ _DWARF_SRC_EXAMPLE2
25
28
  ]
26
29
 
27
30
 
@@ -84,13 +87,15 @@ class FetchSourceFileTester(unittest.TestCase):
84
87
  if content_length == 0:
85
88
  raise Exception("Content-Length is 0")
86
89
 
87
- backend_url = (
88
- backend_host
89
- + "/dwarfsource"
90
- + "/fastledsource/git/fastled/src/FastLED.h"
91
- )
92
- resp = httpx.get(
90
+ backend_url = backend_host + "/dwarfsource"
91
+
92
+ body: dict[str, str] = {
93
+ "path": "fastledsource/git/fastled/src/FastLED.h",
94
+ }
95
+
96
+ resp = httpx.post(
93
97
  backend_url,
98
+ json=body,
94
99
  timeout=100,
95
100
  )
96
101
  if resp.status_code != 200:
@@ -108,11 +113,19 @@ class FetchSourceFileTester(unittest.TestCase):
108
113
  self.assertTrue(resp.status_code == 200, resp.status_code)
109
114
  content_length = int(resp.headers["Content-Length"])
110
115
  self.assertTrue(content_length > 0, "Content-Length is 0")
111
- backend_url = (
112
- backend_host + "/dwarfsource/" + "/".join(url.split("/")[1:])
113
- )
114
- resp = httpx.get(
116
+
117
+ parsed_url = urlparse(url)
118
+ # Extract the path and reconstruct the backend URL
119
+ # print(parsed_url)
120
+
121
+ body: dict[str, str] = {
122
+ "path": parsed_url.path.lstrip("/"), # Remove leading slash
123
+ }
124
+
125
+ backend_url = backend_host + "/dwarfsource"
126
+ resp = httpx.post(
115
127
  backend_url,
128
+ json=body,
116
129
  timeout=100,
117
130
  )
118
131
  if resp.status_code != 200:
@@ -125,8 +138,8 @@ class FetchSourceFileTester(unittest.TestCase):
125
138
  # Work in progress: get system include files.
126
139
  # if resp.status_code != 200:
127
140
  # raise Exception(f"Failed to fetch source file: {resp.status_code}")
128
- # # error drawfsource/js/drawfsour
129
- # url = f"http://localhost:{http_port}/drawfsource/js/drawfsource/emsdk/upstream/emscripten/cache/sysroot/include/ctype.h"
141
+ # # error dwarfsource/js/drawfsour
142
+ # url = f"http://localhost:{http_port}/dwarfsource/js/dwarfsource/emsdk/upstream/emscripten/cache/sysroot/include/ctype.h"
130
143
  # resp = httpx.get(
131
144
  # url,
132
145
  # timeout=100,
@@ -2,6 +2,7 @@
2
2
  Unit test file.
3
3
  """
4
4
 
5
+ import os
5
6
  import random
6
7
  import time
7
8
  import unittest
@@ -9,6 +10,8 @@ from pathlib import Path
9
10
 
10
11
  import httpx
11
12
 
13
+ os.environ["FLASK_SERVER_LOGGING"] = "1"
14
+
12
15
  from fastled import Test
13
16
 
14
17
  HERE = Path(__file__).parent
@@ -63,7 +63,7 @@ build_flags =
63
63
  ${env:wasm-base.build_flags}
64
64
  -g3
65
65
  -gsource-map
66
- -ffile-prefix-map=/=drawfsource/
66
+ -ffile-prefix-map=/=dwarfsource/
67
67
  -fsanitize=address
68
68
  -fsanitize=undefined
69
69
  -fno-inline
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes