fastled 1.3.32__tar.gz → 1.3.34__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.
- {fastled-1.3.32 → fastled-1.3.34}/PKG-INFO +1 -1
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/__init__.py +6 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/__version__.py +1 -1
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/app.py +5 -1
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/args.py +5 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/client_server.py +21 -6
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/compile_server.py +2 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/compile_server_impl.py +4 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/live_client.py +3 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/parse_args.py +12 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/server_flask.py +8 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled.egg-info/PKG-INFO +1 -1
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled.egg-info/SOURCES.txt +2 -0
- fastled-1.3.34/tests/unit/test_cli_no_platformio.py +225 -0
- fastled-1.3.34/tests/unit/test_flask_headers.py +188 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_no_platformio_compile.py +196 -0
- {fastled-1.3.32 → fastled-1.3.34}/.aiderignore +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.cursorrules +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.dockerignore +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.github/workflows/build_multi_docker_image.yml +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.github/workflows/build_webpage.yml +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.github/workflows/lint.yml +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.github/workflows/publish_release.yml +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.github/workflows/template_build_docker_image.yml +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.github/workflows/test_build_exe.yml +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.github/workflows/test_macos.yml +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.github/workflows/test_ubuntu.yml +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.github/workflows/test_win.yml +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.gitignore +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.pylintrc +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.vscode/launch.json +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.vscode/settings.json +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/.vscode/tasks.json +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/DEBUGGER.md +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/Dockerfile +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/FAQ.md +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/LICENSE +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/MANIFEST.in +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/README.md +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/RELEASE.md +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/TODO.md +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/build_exe.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/build_local_docker.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/build_site.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/clean +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/compiler/debug.sh +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/compiler/run.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/demo/100dots.html +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/demo/demo_threejs.html +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/demo/micdemo.html +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/demo/mp3upload.html +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/docker-compose.yml +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/entrypoint.sh +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/install +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/install_linux.sh +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/lint +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/pyproject.toml +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/requirements.docker.txt +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/requirements.testing.txt +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/setup.cfg +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/setup.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/assets/example.txt +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/assets/localhost-key.pem +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/assets/localhost.pem +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/cli.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/cli_test.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/cli_test_interactive.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/docker_manager.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/filewatcher.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/keyboard.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/keyz.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/open_browser.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/paths.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/print_filter.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/project_init.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/select_sketch_directory.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/server_start.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/settings.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/site/build.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/site/examples.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/sketch.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/spinner.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/string_diff.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/test/can_run_local_docker_tests.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/test/examples.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/types.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/util.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/version.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled/web_compile.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled.egg-info/dependency_links.txt +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled.egg-info/entry_points.txt +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled.egg-info/requires.txt +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/src/fastled.egg-info/top_level.txt +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/test +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/integration/test_build_examples.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/integration/test_examples.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/html/index.html +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_api.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_bad_ino.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_banner_string.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_cli.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_compile_server.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_debug_fetch_source_files.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_docker_linux_on_windows.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_embedded_data.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_filechanger.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_http_server.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_ino/bad/bad.ino +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_ino/embedded/wasm.ino +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_ino/wasm/wasm.ino +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_manual_api_invocation.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_project_init.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_server_and_client_seperatly.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_session_compile.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_string_diff.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_version.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/tests/unit/test_webcompile.py +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/upload_package.sh +0 -0
- {fastled-1.3.32 → fastled-1.3.34}/vscode-plugin/readme +0 -0
@@ -64,6 +64,7 @@ class Api:
|
|
64
64
|
http_port: (
|
65
65
|
int | None
|
66
66
|
) = None, # None means auto select a free port. -1 means no server.
|
67
|
+
no_platformio: bool = False,
|
67
68
|
) -> LiveClient:
|
68
69
|
return LiveClient(
|
69
70
|
sketch_directory=sketch_directory,
|
@@ -75,6 +76,7 @@ class Api:
|
|
75
76
|
build_mode=build_mode,
|
76
77
|
profile=profile,
|
77
78
|
http_port=http_port,
|
79
|
+
no_platformio=no_platformio,
|
78
80
|
)
|
79
81
|
|
80
82
|
@staticmethod
|
@@ -85,6 +87,7 @@ class Api:
|
|
85
87
|
mapped_dir: Path | None = None, # Sketch directory.
|
86
88
|
container_name: str | None = None, # Specific docker container name.
|
87
89
|
remove_previous: bool = False,
|
90
|
+
no_platformio: bool = False,
|
88
91
|
) -> CompileServer:
|
89
92
|
"""Uses docker to spawn a compile server from the given name."""
|
90
93
|
from fastled.compile_server import CompileServer
|
@@ -96,6 +99,7 @@ class Api:
|
|
96
99
|
mapped_dir=mapped_dir,
|
97
100
|
auto_start=auto_start,
|
98
101
|
remove_previous=remove_previous,
|
102
|
+
no_platformio=no_platformio,
|
99
103
|
)
|
100
104
|
return out
|
101
105
|
|
@@ -108,6 +112,7 @@ class Api:
|
|
108
112
|
mapped_dir: Path | None = None, # Sketch directory.
|
109
113
|
container_name: str | None = None, # Specific docker container name.
|
110
114
|
remove_previous=False,
|
115
|
+
no_platformio: bool = False,
|
111
116
|
) -> Generator[CompileServer, None, None]:
|
112
117
|
server = Api.spawn_server(
|
113
118
|
interactive=interactive,
|
@@ -116,6 +121,7 @@ class Api:
|
|
116
121
|
mapped_dir=mapped_dir,
|
117
122
|
container_name=container_name,
|
118
123
|
remove_previous=remove_previous,
|
124
|
+
no_platformio=no_platformio,
|
119
125
|
)
|
120
126
|
try:
|
121
127
|
yield server
|
@@ -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.
|
4
|
+
__version__ = "1.3.34"
|
5
5
|
|
6
6
|
__version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
|
@@ -27,6 +27,7 @@ def run_server(args: Args) -> int:
|
|
27
27
|
mapped_dir=mapped_dir,
|
28
28
|
auto_start=True,
|
29
29
|
remove_previous=args.clear,
|
30
|
+
no_platformio=args.no_platformio,
|
30
31
|
)
|
31
32
|
|
32
33
|
if not interactive:
|
@@ -87,7 +88,9 @@ def main() -> int:
|
|
87
88
|
|
88
89
|
if update:
|
89
90
|
# Force auto_update to ensure update check happens
|
90
|
-
compile_server = CompileServer(
|
91
|
+
compile_server = CompileServer(
|
92
|
+
interactive=False, auto_updates=True, no_platformio=args.no_platformio
|
93
|
+
)
|
91
94
|
compile_server.stop()
|
92
95
|
print("Finished updating.")
|
93
96
|
return 0
|
@@ -109,6 +112,7 @@ def main() -> int:
|
|
109
112
|
mapped_dir=directory,
|
110
113
|
auto_start=False,
|
111
114
|
remove_previous=args.clear,
|
115
|
+
no_platformio=args.no_platformio,
|
112
116
|
)
|
113
117
|
|
114
118
|
server.start(wait_for_startup=False)
|
@@ -12,6 +12,7 @@ class Args:
|
|
12
12
|
interactive: bool
|
13
13
|
profile: bool
|
14
14
|
force_compile: bool
|
15
|
+
no_platformio: bool
|
15
16
|
auto_update: bool | None
|
16
17
|
update: bool
|
17
18
|
localhost: bool
|
@@ -47,6 +48,9 @@ class Args:
|
|
47
48
|
assert isinstance(
|
48
49
|
args.force_compile, bool
|
49
50
|
), f"expected bool, got {type(args.force_compile)}"
|
51
|
+
assert isinstance(
|
52
|
+
args.no_platformio, bool
|
53
|
+
), f"expected bool, got {type(args.no_platformio)}"
|
50
54
|
assert isinstance(
|
51
55
|
args.no_auto_updates, bool | None
|
52
56
|
), f"expected bool | None, got {type(args.no_auto_updates)}"
|
@@ -78,6 +82,7 @@ class Args:
|
|
78
82
|
interactive=args.interactive,
|
79
83
|
profile=args.profile,
|
80
84
|
force_compile=args.force_compile,
|
85
|
+
no_platformio=args.no_platformio,
|
81
86
|
auto_update=not args.no_auto_updates,
|
82
87
|
update=args.update,
|
83
88
|
localhost=args.localhost,
|
@@ -130,7 +130,11 @@ def _run_web_compiler(
|
|
130
130
|
|
131
131
|
|
132
132
|
def _try_start_server_or_get_url(
|
133
|
-
auto_update: bool,
|
133
|
+
auto_update: bool,
|
134
|
+
args_web: str | bool,
|
135
|
+
localhost: bool,
|
136
|
+
clear: bool,
|
137
|
+
no_platformio: bool = False,
|
134
138
|
) -> tuple[str, CompileServer | None]:
|
135
139
|
is_local_host = localhost or (
|
136
140
|
isinstance(args_web, str)
|
@@ -161,7 +165,9 @@ def _try_start_server_or_get_url(
|
|
161
165
|
try:
|
162
166
|
print("No local server found, starting one...")
|
163
167
|
compile_server = CompileServer(
|
164
|
-
auto_updates=auto_update,
|
168
|
+
auto_updates=auto_update,
|
169
|
+
remove_previous=clear,
|
170
|
+
no_platformio=no_platformio,
|
165
171
|
)
|
166
172
|
print("Waiting for the local compiler to start...")
|
167
173
|
if not compile_server.ping():
|
@@ -177,7 +183,9 @@ def _try_start_server_or_get_url(
|
|
177
183
|
return (DEFAULT_URL, None)
|
178
184
|
|
179
185
|
|
180
|
-
def _try_make_compile_server(
|
186
|
+
def _try_make_compile_server(
|
187
|
+
clear: bool = False, no_platformio: bool = False
|
188
|
+
) -> CompileServer | None:
|
181
189
|
if not DockerManager.is_docker_installed():
|
182
190
|
return None
|
183
191
|
try:
|
@@ -189,7 +197,9 @@ def _try_make_compile_server(clear: bool = False) -> CompileServer | None:
|
|
189
197
|
free_port = find_free_port(start_port=9723, end_port=9743)
|
190
198
|
if free_port is None:
|
191
199
|
return None
|
192
|
-
compile_server = CompileServer(
|
200
|
+
compile_server = CompileServer(
|
201
|
+
auto_updates=False, remove_previous=clear, no_platformio=no_platformio
|
202
|
+
)
|
193
203
|
print("Waiting for the local compiler to start...")
|
194
204
|
if not compile_server.ping():
|
195
205
|
print("Failed to start local compiler.")
|
@@ -228,13 +238,16 @@ def run_client(
|
|
228
238
|
int | None
|
229
239
|
) = None, # None means auto select a free port, http_port < 0 means no server.
|
230
240
|
clear: bool = False,
|
241
|
+
no_platformio: bool = False,
|
231
242
|
) -> int:
|
232
243
|
has_checked_newer_version_yet = False
|
233
244
|
compile_server: CompileServer | None = None
|
234
245
|
|
235
246
|
if host is None:
|
236
247
|
# attempt to start a compile server if docker is installed.
|
237
|
-
compile_server = _try_make_compile_server(
|
248
|
+
compile_server = _try_make_compile_server(
|
249
|
+
clear=clear, no_platformio=no_platformio
|
250
|
+
)
|
238
251
|
if compile_server is None:
|
239
252
|
host = DEFAULT_URL
|
240
253
|
elif isinstance(host, CompileServer):
|
@@ -463,6 +476,7 @@ def run_client_server(args: Args) -> int:
|
|
463
476
|
force_compile = bool(args.force_compile)
|
464
477
|
open_web_browser = not just_compile and not interactive
|
465
478
|
build_mode: BuildMode = BuildMode.from_args(args)
|
479
|
+
no_platformio = bool(args.no_platformio)
|
466
480
|
|
467
481
|
if not force_compile and not looks_like_sketch_directory(directory):
|
468
482
|
# if there is only one directory in the sketch directory, use that
|
@@ -492,7 +506,7 @@ def run_client_server(args: Args) -> int:
|
|
492
506
|
compile_server: CompileServer | None = None
|
493
507
|
try:
|
494
508
|
url, compile_server = _try_start_server_or_get_url(
|
495
|
-
auto_update, web, localhost, args.clear
|
509
|
+
auto_update, web, localhost, args.clear, no_platformio
|
496
510
|
)
|
497
511
|
except KeyboardInterrupt:
|
498
512
|
print("\nExiting from first try...")
|
@@ -524,6 +538,7 @@ def run_client_server(args: Args) -> int:
|
|
524
538
|
build_mode=build_mode,
|
525
539
|
profile=profile,
|
526
540
|
clear=args.clear,
|
541
|
+
no_platformio=no_platformio,
|
527
542
|
)
|
528
543
|
except KeyboardInterrupt:
|
529
544
|
return 1
|
@@ -15,6 +15,7 @@ class CompileServer:
|
|
15
15
|
container_name: str | None = None,
|
16
16
|
platform: Platform = Platform.WASM,
|
17
17
|
remove_previous: bool = False,
|
18
|
+
no_platformio: bool = False,
|
18
19
|
) -> None:
|
19
20
|
from fastled.compile_server_impl import ( # avoid circular import
|
20
21
|
CompileServerImpl,
|
@@ -29,6 +30,7 @@ class CompileServer:
|
|
29
30
|
mapped_dir=mapped_dir,
|
30
31
|
auto_start=auto_start,
|
31
32
|
remove_previous=remove_previous,
|
33
|
+
no_platformio=no_platformio,
|
32
34
|
)
|
33
35
|
|
34
36
|
# May throw CompileServerError if server could not be started.
|
@@ -50,6 +50,7 @@ class CompileServerImpl:
|
|
50
50
|
auto_start: bool = True,
|
51
51
|
container_name: str | None = None,
|
52
52
|
remove_previous: bool = False,
|
53
|
+
no_platformio: bool = False,
|
53
54
|
) -> None:
|
54
55
|
container_name = container_name or DEFAULT_CONTAINER_NAME
|
55
56
|
if interactive and not mapped_dir:
|
@@ -68,6 +69,7 @@ class CompileServerImpl:
|
|
68
69
|
self.running_container: RunningContainer | None = None
|
69
70
|
self.auto_updates = auto_updates
|
70
71
|
self.remove_previous = remove_previous
|
72
|
+
self.no_platformio = no_platformio
|
71
73
|
self._port = 0 # 0 until compile server is started
|
72
74
|
if auto_start:
|
73
75
|
self.start()
|
@@ -217,6 +219,8 @@ class CompileServerImpl:
|
|
217
219
|
server_command = ["/bin/bash"]
|
218
220
|
else:
|
219
221
|
server_command = ["python", "/js/run.py", "server"] + SERVER_OPTIONS
|
222
|
+
if self.no_platformio:
|
223
|
+
server_command.append("--no-platformio")
|
220
224
|
if self.interactive:
|
221
225
|
print("Disabling port forwarding in interactive mode")
|
222
226
|
ports = {}
|
@@ -22,6 +22,7 @@ class LiveClient:
|
|
22
22
|
keep_running: bool = True,
|
23
23
|
build_mode: BuildMode = BuildMode.QUICK,
|
24
24
|
profile: bool = False,
|
25
|
+
no_platformio: bool = False,
|
25
26
|
) -> None:
|
26
27
|
self.sketch_directory = sketch_directory
|
27
28
|
self.host = host
|
@@ -34,6 +35,7 @@ class LiveClient:
|
|
34
35
|
self.shutdown = threading.Event()
|
35
36
|
self.thread: threading.Thread | None = None
|
36
37
|
self.auto_updates = auto_updates
|
38
|
+
self.no_platformio = no_platformio
|
37
39
|
if auto_start:
|
38
40
|
self.start()
|
39
41
|
if self.auto_updates is False:
|
@@ -52,6 +54,7 @@ class LiveClient:
|
|
52
54
|
profile=self.profile,
|
53
55
|
shutdown=self.shutdown,
|
54
56
|
http_port=self.http_port,
|
57
|
+
no_platformio=self.no_platformio,
|
55
58
|
)
|
56
59
|
return rtn
|
57
60
|
|
@@ -30,6 +30,7 @@ FastLED WASM Compiler - Useful options:
|
|
30
30
|
--init [example] Initialize one of the top tier WASM examples
|
31
31
|
--web [url] Use web compiler
|
32
32
|
--server Run the compiler server
|
33
|
+
--no-platformio Bypass PlatformIO constraints using local Docker compilation
|
33
34
|
--quick Build in quick mode (default)
|
34
35
|
--profile Enable profiling the C++ build system
|
35
36
|
--update Update the docker image for the wasm compiler
|
@@ -114,6 +115,11 @@ def parse_args() -> Args:
|
|
114
115
|
action="store_true",
|
115
116
|
help="Disable automatic updates of the wasm compiler image when using docker.",
|
116
117
|
)
|
118
|
+
parser.add_argument(
|
119
|
+
"--no-platformio",
|
120
|
+
action="store_true",
|
121
|
+
help="Bypass PlatformIO constraints by using local Docker compilation with custom build environment",
|
122
|
+
)
|
117
123
|
parser.add_argument(
|
118
124
|
"-u",
|
119
125
|
"--update",
|
@@ -268,6 +274,12 @@ def parse_args() -> Args:
|
|
268
274
|
if cwd_is_fastled and not args.web and not args.server:
|
269
275
|
print("Forcing --local mode because we are in the FastLED repo")
|
270
276
|
args.localhost = True
|
277
|
+
if args.no_platformio:
|
278
|
+
print(
|
279
|
+
"--no-platformio mode enabled: forcing local Docker compilation to bypass PlatformIO constraints"
|
280
|
+
)
|
281
|
+
args.localhost = True
|
282
|
+
args.web = None # Clear web flag to ensure local compilation
|
271
283
|
if args.localhost:
|
272
284
|
args.web = "localhost"
|
273
285
|
if args.interactive and not args.server:
|
@@ -85,6 +85,14 @@ def _run_flask_server(
|
|
85
85
|
|
86
86
|
# logger.error(f"Server error: {e}")
|
87
87
|
|
88
|
+
@app.after_request
|
89
|
+
def add_security_headers(response):
|
90
|
+
"""Add security headers required for cross-origin isolation and audio worklets"""
|
91
|
+
# Required for SharedArrayBuffer and audio worklets
|
92
|
+
response.headers["Cross-Origin-Embedder-Policy"] = "credentialless"
|
93
|
+
response.headers["Cross-Origin-Opener-Policy"] = "same-origin"
|
94
|
+
return response
|
95
|
+
|
88
96
|
@app.before_request
|
89
97
|
def log_request_info():
|
90
98
|
"""Log details of each request before processing"""
|
@@ -95,11 +95,13 @@ tests/unit/test_api.py
|
|
95
95
|
tests/unit/test_bad_ino.py
|
96
96
|
tests/unit/test_banner_string.py
|
97
97
|
tests/unit/test_cli.py
|
98
|
+
tests/unit/test_cli_no_platformio.py
|
98
99
|
tests/unit/test_compile_server.py
|
99
100
|
tests/unit/test_debug_fetch_source_files.py
|
100
101
|
tests/unit/test_docker_linux_on_windows.py
|
101
102
|
tests/unit/test_embedded_data.py
|
102
103
|
tests/unit/test_filechanger.py
|
104
|
+
tests/unit/test_flask_headers.py
|
103
105
|
tests/unit/test_http_server.py
|
104
106
|
tests/unit/test_manual_api_invocation.py
|
105
107
|
tests/unit/test_no_platformio_compile.py
|
@@ -0,0 +1,225 @@
|
|
1
|
+
"""
|
2
|
+
Unit test for FastLED CLI --no-platformio flag functionality.
|
3
|
+
Tests that the CLI correctly handles the --no-platformio argument and compiles successfully.
|
4
|
+
"""
|
5
|
+
|
6
|
+
import os
|
7
|
+
import platform
|
8
|
+
import subprocess
|
9
|
+
import unittest
|
10
|
+
from pathlib import Path
|
11
|
+
|
12
|
+
HERE = Path(__file__).parent
|
13
|
+
TEST_SKETCH_DIR = HERE / "test_ino" / "wasm"
|
14
|
+
WORKSPACE_ROOT = HERE.parent.parent
|
15
|
+
|
16
|
+
|
17
|
+
def _enabled() -> bool:
|
18
|
+
"""Check if this system can run the tests."""
|
19
|
+
is_github_runner = "GITHUB_ACTIONS" in os.environ
|
20
|
+
if not is_github_runner:
|
21
|
+
return True
|
22
|
+
# This only works in ubuntu at the moment
|
23
|
+
return platform.system() == "Linux"
|
24
|
+
|
25
|
+
|
26
|
+
def _docker_available() -> bool:
|
27
|
+
"""Check if Docker is available for no-platformio compilation."""
|
28
|
+
try:
|
29
|
+
from fastled.docker_manager import DockerManager
|
30
|
+
|
31
|
+
return DockerManager.is_docker_installed()
|
32
|
+
except Exception as e:
|
33
|
+
print(f"Docker is not available: {e}")
|
34
|
+
return False
|
35
|
+
|
36
|
+
|
37
|
+
class CLINoPlatformIOTest(unittest.TestCase):
|
38
|
+
"""Test FastLED CLI --no-platformio flag functionality."""
|
39
|
+
|
40
|
+
def test_no_platformio_flag_recognized(self) -> None:
|
41
|
+
"""Test that --no-platformio flag is recognized by the CLI without errors."""
|
42
|
+
|
43
|
+
# Test that the flag is recognized in help
|
44
|
+
result = subprocess.run(
|
45
|
+
["uv", "run", "fastled", "--help"],
|
46
|
+
cwd=WORKSPACE_ROOT,
|
47
|
+
capture_output=True,
|
48
|
+
text=True,
|
49
|
+
timeout=30,
|
50
|
+
)
|
51
|
+
|
52
|
+
self.assertEqual(result.returncode, 0, "Help command should succeed")
|
53
|
+
self.assertIn(
|
54
|
+
"--no-platformio", result.stdout, "--no-platformio should appear in help"
|
55
|
+
)
|
56
|
+
self.assertIn(
|
57
|
+
"Bypass PlatformIO constraints",
|
58
|
+
result.stdout,
|
59
|
+
"Help text should be present",
|
60
|
+
)
|
61
|
+
|
62
|
+
def test_no_platformio_flag_parsing(self) -> None:
|
63
|
+
"""Test that --no-platformio flag is parsed correctly without compilation."""
|
64
|
+
|
65
|
+
# Ensure test sketch directory exists
|
66
|
+
self.assertTrue(
|
67
|
+
TEST_SKETCH_DIR.exists(),
|
68
|
+
f"Test sketch directory not found: {TEST_SKETCH_DIR}",
|
69
|
+
)
|
70
|
+
|
71
|
+
# Test with --help to verify flag parsing without triggering compilation
|
72
|
+
result = subprocess.run(
|
73
|
+
["uv", "run", "fastled", str(TEST_SKETCH_DIR), "--no-platformio", "--help"],
|
74
|
+
cwd=WORKSPACE_ROOT,
|
75
|
+
capture_output=True,
|
76
|
+
text=True,
|
77
|
+
timeout=30,
|
78
|
+
)
|
79
|
+
|
80
|
+
self.assertEqual(result.returncode, 0, "CLI should accept --no-platformio flag")
|
81
|
+
self.assertIn(
|
82
|
+
"--no-platformio", result.stdout, "--no-platformio should be in help output"
|
83
|
+
)
|
84
|
+
|
85
|
+
@unittest.skipUnless(
|
86
|
+
_enabled(),
|
87
|
+
"Test requires Linux environment",
|
88
|
+
)
|
89
|
+
def test_no_platformio_flag_forces_local_mode(self) -> None:
|
90
|
+
"""Test that --no-platformio flag correctly forces local Docker compilation mode."""
|
91
|
+
|
92
|
+
# Ensure test sketch directory exists
|
93
|
+
self.assertTrue(
|
94
|
+
TEST_SKETCH_DIR.exists(),
|
95
|
+
f"Test sketch directory not found: {TEST_SKETCH_DIR}",
|
96
|
+
)
|
97
|
+
|
98
|
+
# Run with --no-platformio and --just-compile to avoid browser opening
|
99
|
+
# Use a short timeout to avoid long waits if compilation hangs
|
100
|
+
try:
|
101
|
+
result = subprocess.run(
|
102
|
+
[
|
103
|
+
"uv",
|
104
|
+
"run",
|
105
|
+
"fastled",
|
106
|
+
str(TEST_SKETCH_DIR),
|
107
|
+
"--no-platformio",
|
108
|
+
"--just-compile",
|
109
|
+
],
|
110
|
+
cwd=WORKSPACE_ROOT,
|
111
|
+
capture_output=True,
|
112
|
+
text=True,
|
113
|
+
timeout=180, # 3 minutes timeout
|
114
|
+
)
|
115
|
+
|
116
|
+
# Check that the --no-platformio message appears
|
117
|
+
output = result.stdout + result.stderr
|
118
|
+
self.assertIn(
|
119
|
+
"--no-platformio mode enabled: forcing local Docker compilation to bypass PlatformIO constraints",
|
120
|
+
output,
|
121
|
+
"Should display --no-platformio mode message",
|
122
|
+
)
|
123
|
+
|
124
|
+
# Check that it attempts local compilation (even if Docker isn't available)
|
125
|
+
self.assertTrue(
|
126
|
+
"localhost" in output.lower()
|
127
|
+
or "local" in output.lower()
|
128
|
+
or "docker" in output.lower(),
|
129
|
+
"Should attempt local compilation mode",
|
130
|
+
)
|
131
|
+
|
132
|
+
# If compilation succeeded, verify success
|
133
|
+
if result.returncode == 0:
|
134
|
+
self.assertIn(
|
135
|
+
"compilation success",
|
136
|
+
output.lower(),
|
137
|
+
"Should indicate compilation success",
|
138
|
+
)
|
139
|
+
print("✅ --no-platformio CLI compilation succeeded!")
|
140
|
+
else:
|
141
|
+
# If it failed, it should be due to Docker not being available or similar infrastructure issue
|
142
|
+
# The important thing is that the flag was recognized and processed
|
143
|
+
self.assertNotIn(
|
144
|
+
"unrecognized arguments", output, "Flag should be recognized"
|
145
|
+
)
|
146
|
+
print(
|
147
|
+
f"ℹ️ --no-platformio flag processed correctly (exit code: {result.returncode})"
|
148
|
+
)
|
149
|
+
print(
|
150
|
+
f"Output: {output[:500]}..."
|
151
|
+
) # Print first 500 chars for debugging
|
152
|
+
|
153
|
+
except subprocess.TimeoutExpired:
|
154
|
+
self.fail(
|
155
|
+
"Command timed out - this suggests the flag was processed but compilation took too long"
|
156
|
+
)
|
157
|
+
|
158
|
+
def test_no_platformio_cli_argument_structure(self) -> None:
|
159
|
+
"""Test the CLI argument structure for --no-platformio flag."""
|
160
|
+
|
161
|
+
# Test that the flag doesn't conflict with other flags
|
162
|
+
conflicting_flags = [
|
163
|
+
["--web"],
|
164
|
+
["--server"],
|
165
|
+
["--debug"],
|
166
|
+
["--quick"],
|
167
|
+
["--release"],
|
168
|
+
]
|
169
|
+
|
170
|
+
for flags in conflicting_flags:
|
171
|
+
with self.subTest(flags=flags):
|
172
|
+
# Test help output to ensure no argument conflicts
|
173
|
+
cmd = ["uv", "run", "fastled", "--no-platformio"] + flags + ["--help"]
|
174
|
+
result = subprocess.run(
|
175
|
+
cmd, cwd=WORKSPACE_ROOT, capture_output=True, text=True, timeout=30
|
176
|
+
)
|
177
|
+
|
178
|
+
self.assertEqual(
|
179
|
+
result.returncode, 0, f"Should accept --no-platformio with {flags}"
|
180
|
+
)
|
181
|
+
self.assertNotIn(
|
182
|
+
"error:",
|
183
|
+
result.stderr.lower(),
|
184
|
+
f"No errors with --no-platformio + {flags}",
|
185
|
+
)
|
186
|
+
|
187
|
+
def test_no_platformio_with_different_sketch_directories(self) -> None:
|
188
|
+
"""Test --no-platformio flag with different test sketch directories."""
|
189
|
+
|
190
|
+
test_sketches = [
|
191
|
+
TEST_SKETCH_DIR, # wasm sketch
|
192
|
+
HERE / "test_ino" / "embedded", # embedded sketch
|
193
|
+
]
|
194
|
+
|
195
|
+
for sketch_dir in test_sketches:
|
196
|
+
if sketch_dir.exists():
|
197
|
+
with self.subTest(sketch_dir=sketch_dir):
|
198
|
+
# Test with --help to verify flag parsing
|
199
|
+
result = subprocess.run(
|
200
|
+
[
|
201
|
+
"uv",
|
202
|
+
"run",
|
203
|
+
"fastled",
|
204
|
+
str(sketch_dir),
|
205
|
+
"--no-platformio",
|
206
|
+
"--help",
|
207
|
+
],
|
208
|
+
cwd=WORKSPACE_ROOT,
|
209
|
+
capture_output=True,
|
210
|
+
text=True,
|
211
|
+
timeout=30,
|
212
|
+
)
|
213
|
+
|
214
|
+
self.assertEqual(
|
215
|
+
result.returncode, 0, f"Should work with sketch at {sketch_dir}"
|
216
|
+
)
|
217
|
+
self.assertIn(
|
218
|
+
"--no-platformio",
|
219
|
+
result.stdout,
|
220
|
+
"Flag should be present in help",
|
221
|
+
)
|
222
|
+
|
223
|
+
|
224
|
+
if __name__ == "__main__":
|
225
|
+
unittest.main()
|