fastled 1.2.40__py3-none-any.whl → 1.2.42__py3-none-any.whl
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/__init__.py +5 -186
- fastled/app.py +6 -0
- fastled/compile_server_impl.py +0 -1
- fastled/docker_manager.py +3 -1
- fastled/interactive_srcs.py +3 -3
- fastled/parse_args.py +4 -0
- {fastled-1.2.40.dist-info → fastled-1.2.42.dist-info}/METADATA +3 -1
- {fastled-1.2.40.dist-info → fastled-1.2.42.dist-info}/RECORD +12 -12
- {fastled-1.2.40.dist-info → fastled-1.2.42.dist-info}/WHEEL +1 -1
- {fastled-1.2.40.dist-info → fastled-1.2.42.dist-info}/LICENSE +0 -0
- {fastled-1.2.40.dist-info → fastled-1.2.42.dist-info}/entry_points.txt +0 -0
- {fastled-1.2.40.dist-info → fastled-1.2.42.dist-info}/top_level.txt +0 -0
fastled/__init__.py
CHANGED
@@ -1,8 +1,5 @@
|
|
1
1
|
"""FastLED Wasm Compiler package."""
|
2
2
|
|
3
|
-
# context
|
4
|
-
import shutil
|
5
|
-
import subprocess
|
6
3
|
from contextlib import contextmanager
|
7
4
|
from multiprocessing import Process
|
8
5
|
from pathlib import Path
|
@@ -16,7 +13,11 @@ from .types import BuildMode, CompileResult, CompileServerError
|
|
16
13
|
# IMPORTANT! There's a bug in github which will REJECT any version update
|
17
14
|
# that has any other change in the repo. Please bump the version as the
|
18
15
|
# ONLY change in a commit, or else the pypi update and the release will fail.
|
19
|
-
__version__ = "1.2.
|
16
|
+
__version__ = "1.2.42"
|
17
|
+
|
18
|
+
DOCKER_FILE = (
|
19
|
+
"https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/Dockerfile"
|
20
|
+
)
|
20
21
|
|
21
22
|
|
22
23
|
class Api:
|
@@ -156,188 +157,6 @@ class Docker:
|
|
156
157
|
docker_mgr = DockerManager()
|
157
158
|
docker_mgr.purge(image_name=IMAGE_NAME)
|
158
159
|
|
159
|
-
@staticmethod
|
160
|
-
def spawn_server_from_github(
|
161
|
-
url: str = "https://github.com/fastled/fastled",
|
162
|
-
output_dir: Path | str = Path(".cache/fastled"),
|
163
|
-
) -> CompileServer:
|
164
|
-
"""Build the FastLED WASM compiler Docker image from a GitHub repository.
|
165
|
-
|
166
|
-
Args:
|
167
|
-
url: GitHub repository URL (default: https://github.com/fastled/fastled)
|
168
|
-
output_dir: Directory to clone the repo into (default: .cache/fastled)
|
169
|
-
|
170
|
-
Returns:
|
171
|
-
Container name.
|
172
|
-
"""
|
173
|
-
|
174
|
-
from fastled.docker_manager import DockerManager
|
175
|
-
from fastled.settings import CONTAINER_NAME, IMAGE_NAME
|
176
|
-
|
177
|
-
if isinstance(output_dir, str):
|
178
|
-
output_dir = Path(output_dir)
|
179
|
-
|
180
|
-
# Create output directory if it doesn't exist
|
181
|
-
output_dir.mkdir(parents=True, exist_ok=True)
|
182
|
-
|
183
|
-
git_dir = output_dir / ".git"
|
184
|
-
library_properties = output_dir / "library.properties"
|
185
|
-
|
186
|
-
git_dir_exists = git_dir.exists()
|
187
|
-
library_properties_exists = library_properties.exists()
|
188
|
-
library_properties_text = (
|
189
|
-
library_properties.read_text().strip() if library_properties_exists else ""
|
190
|
-
)
|
191
|
-
|
192
|
-
already_exists = (
|
193
|
-
git_dir_exists
|
194
|
-
and library_properties_exists
|
195
|
-
and "FastLED" in library_properties_text
|
196
|
-
)
|
197
|
-
if git_dir_exists and not already_exists:
|
198
|
-
if ".cache/fastled" in str(output_dir.as_posix()):
|
199
|
-
shutil.rmtree(output_dir)
|
200
|
-
already_exists = False
|
201
|
-
else:
|
202
|
-
raise ValueError(
|
203
|
-
f"Output directory {output_dir} already exists but does not appear to be a FastLED repository."
|
204
|
-
)
|
205
|
-
|
206
|
-
# Clone or update the repository
|
207
|
-
if already_exists:
|
208
|
-
print(f"Updating existing repository in {output_dir}")
|
209
|
-
# Reset local changes and move HEAD back to handle force pushes
|
210
|
-
subprocess.run(
|
211
|
-
["git", "reset", "--hard", "HEAD~10"],
|
212
|
-
cwd=output_dir,
|
213
|
-
check=False,
|
214
|
-
capture_output=True, # Suppress output of reset
|
215
|
-
)
|
216
|
-
subprocess.run(
|
217
|
-
["git", "pull", "origin", "master"], cwd=output_dir, check=True
|
218
|
-
)
|
219
|
-
else:
|
220
|
-
print(f"Cloning {url} into {output_dir}")
|
221
|
-
subprocess.run(
|
222
|
-
["git", "clone", "--depth", "1", url, str(output_dir)], check=True
|
223
|
-
)
|
224
|
-
|
225
|
-
dockerfile_path = (
|
226
|
-
output_dir / "src" / "platforms" / "wasm" / "compiler" / "Dockerfile"
|
227
|
-
)
|
228
|
-
|
229
|
-
if not dockerfile_path.exists():
|
230
|
-
raise FileNotFoundError(
|
231
|
-
f"Dockerfile not found at {dockerfile_path}. "
|
232
|
-
"This may not be a valid FastLED repository."
|
233
|
-
)
|
234
|
-
|
235
|
-
docker_mgr = DockerManager()
|
236
|
-
|
237
|
-
platform_tag = ""
|
238
|
-
# if "arm" in docker_mgr.architecture():
|
239
|
-
if (
|
240
|
-
"arm"
|
241
|
-
in subprocess.run(["uname", "-m"], capture_output=True).stdout.decode()
|
242
|
-
):
|
243
|
-
platform_tag = "-arm64"
|
244
|
-
|
245
|
-
# Build the image
|
246
|
-
docker_mgr.build_image(
|
247
|
-
image_name=IMAGE_NAME,
|
248
|
-
tag="main",
|
249
|
-
dockerfile_path=dockerfile_path,
|
250
|
-
build_context=output_dir,
|
251
|
-
build_args={"NO_PREWARM": "1"},
|
252
|
-
platform_tag=platform_tag,
|
253
|
-
)
|
254
|
-
|
255
|
-
# # Run the container and return it
|
256
|
-
# container = docker_mgr.run_container_detached(
|
257
|
-
# image_name=IMAGE_NAME,
|
258
|
-
# tag="main",
|
259
|
-
# container_name=CONTAINER_NAME,
|
260
|
-
# command=None, # Use default command from Dockerfile
|
261
|
-
# volumes=None, # No volumes needed for build
|
262
|
-
# ports=None, # No ports needed for build
|
263
|
-
# remove_previous=True, # Remove any existing container
|
264
|
-
# )
|
265
|
-
# name = container.name
|
266
|
-
# container.stop()
|
267
|
-
|
268
|
-
out: CompileServer = CompileServer(
|
269
|
-
container_name=CONTAINER_NAME,
|
270
|
-
interactive=False,
|
271
|
-
auto_updates=False,
|
272
|
-
mapped_dir=None,
|
273
|
-
auto_start=True,
|
274
|
-
remove_previous=True,
|
275
|
-
)
|
276
|
-
|
277
|
-
return out
|
278
|
-
|
279
|
-
@staticmethod
|
280
|
-
def spawn_server_from_fastled_repo(
|
281
|
-
project_root: Path | str = Path("."),
|
282
|
-
interactive: bool = False,
|
283
|
-
sketch_folder: Path | None = None,
|
284
|
-
) -> CompileServer:
|
285
|
-
"""Build the FastLED WASM compiler Docker image, which will be tagged as "main".
|
286
|
-
|
287
|
-
Args:
|
288
|
-
project_root: Path to the FastLED project root directory
|
289
|
-
platform_tag: Optional platform tag (e.g. "-arm64" for ARM builds)
|
290
|
-
|
291
|
-
Returns:
|
292
|
-
The string name of the docker container.
|
293
|
-
"""
|
294
|
-
from fastled.docker_manager import DockerManager
|
295
|
-
from fastled.settings import CONTAINER_NAME, IMAGE_NAME
|
296
|
-
|
297
|
-
project_root = Path(project_root)
|
298
|
-
if interactive:
|
299
|
-
if sketch_folder is None:
|
300
|
-
sketch_folder = project_root / "examples" / "wasm"
|
301
|
-
|
302
|
-
if isinstance(project_root, str):
|
303
|
-
project_root = Path(project_root)
|
304
|
-
|
305
|
-
dockerfile_path = (
|
306
|
-
project_root / "src" / "platforms" / "wasm" / "compiler" / "Dockerfile"
|
307
|
-
)
|
308
|
-
docker_mgr = DockerManager()
|
309
|
-
platform_tag = ""
|
310
|
-
# if "arm" in docker_mgr.architecture():
|
311
|
-
if (
|
312
|
-
"arm"
|
313
|
-
in subprocess.run(["uname", "-m"], capture_output=True).stdout.decode()
|
314
|
-
):
|
315
|
-
platform_tag = "-arm64"
|
316
|
-
|
317
|
-
# if image exists, remove it
|
318
|
-
docker_mgr.purge(image_name=IMAGE_NAME)
|
319
|
-
|
320
|
-
# Build the image
|
321
|
-
docker_mgr.build_image(
|
322
|
-
image_name=IMAGE_NAME,
|
323
|
-
tag="main",
|
324
|
-
dockerfile_path=dockerfile_path,
|
325
|
-
build_context=project_root,
|
326
|
-
build_args={"NO_PREWARM": "1"},
|
327
|
-
platform_tag=platform_tag,
|
328
|
-
)
|
329
|
-
|
330
|
-
out: CompileServer = CompileServer(
|
331
|
-
container_name=CONTAINER_NAME,
|
332
|
-
interactive=interactive,
|
333
|
-
auto_updates=False,
|
334
|
-
mapped_dir=sketch_folder,
|
335
|
-
auto_start=True,
|
336
|
-
remove_previous=True,
|
337
|
-
)
|
338
|
-
|
339
|
-
return out
|
340
|
-
|
341
160
|
|
342
161
|
class Tools:
|
343
162
|
@staticmethod
|
fastled/app.py
CHANGED
@@ -60,6 +60,11 @@ def main() -> int:
|
|
60
60
|
return 0
|
61
61
|
|
62
62
|
if build:
|
63
|
+
print("Building is disabled")
|
64
|
+
build = False
|
65
|
+
|
66
|
+
if build:
|
67
|
+
raise NotImplementedError("Building is not yet supported.")
|
63
68
|
file_watcher_set(False)
|
64
69
|
project_root = Path(".").absolute()
|
65
70
|
print(f"Building Docker image at {project_root}")
|
@@ -110,6 +115,7 @@ def main() -> int:
|
|
110
115
|
if __name__ == "__main__":
|
111
116
|
# Note that the entry point for the exe is in cli.py
|
112
117
|
try:
|
118
|
+
sys.argv.append("-i")
|
113
119
|
sys.argv.append("-b")
|
114
120
|
# sys.argv.append("examples/wasm")
|
115
121
|
# sys.argv.append()
|
fastled/compile_server_impl.py
CHANGED
@@ -220,7 +220,6 @@ class CompileServerImpl:
|
|
220
220
|
"mode": "rw",
|
221
221
|
}
|
222
222
|
if self.fastled_src_dir is not None:
|
223
|
-
# add volume for src/platforms/wasm/compiler/CMakelists.txt
|
224
223
|
# to allow for interactive compilation
|
225
224
|
interactive_sources = list(INTERACTIVE_SOURCES)
|
226
225
|
for src in interactive_sources:
|
fastled/docker_manager.py
CHANGED
@@ -694,7 +694,9 @@ class DockerManager:
|
|
694
694
|
print("Error decoding line")
|
695
695
|
rtn = proc.wait()
|
696
696
|
if rtn != 0:
|
697
|
-
|
697
|
+
warnings.warn(
|
698
|
+
f"Error building Docker image, is docker running? {rtn}, stdout: {stdout}, stderr: {proc.stderr}"
|
699
|
+
)
|
698
700
|
raise subprocess.CalledProcessError(rtn, cmd_str)
|
699
701
|
print(f"Successfully built image {image_name}:{tag}")
|
700
702
|
|
fastled/interactive_srcs.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
INTERACTIVE_SOURCES: list[str] = [
|
2
|
-
"
|
3
|
-
"
|
4
|
-
"
|
2
|
+
"/js/compiler/CMakeLists.txt",
|
3
|
+
"/js/compiler/build_archive.sh",
|
4
|
+
"/js/compiler/build.sh",
|
5
5
|
]
|
fastled/parse_args.py
CHANGED
@@ -155,6 +155,10 @@ def parse_args() -> Args:
|
|
155
155
|
os.chdir(fastled_dir)
|
156
156
|
if args.directory is None:
|
157
157
|
args.directory = str(Path("examples/wasm").absolute())
|
158
|
+
if args.interactive:
|
159
|
+
if not args.build:
|
160
|
+
print("Adding --build flag when using --interactive")
|
161
|
+
args.build = True
|
158
162
|
return Args.from_namespace(args)
|
159
163
|
|
160
164
|
if not args.update:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.42
|
4
4
|
Summary: FastLED Wasm Compiler
|
5
5
|
Home-page: https://github.com/zackees/fastled-wasm
|
6
6
|
Maintainer: Zachary Vorhies
|
@@ -294,6 +294,8 @@ A: `delay()` will block `loop()` which blocks the main thread of the browser. Th
|
|
294
294
|
Q: How can I get the compiled size of my FastLED sketch smaller?
|
295
295
|
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.
|
296
296
|
|
297
|
+
|
298
|
+
|
297
299
|
# Revisions
|
298
300
|
|
299
301
|
* 1.2.31 - Bunch of fixes and ease of use while compiling code in the repo.
|
@@ -1,17 +1,17 @@
|
|
1
|
-
fastled/__init__.py,sha256=
|
2
|
-
fastled/app.py,sha256=
|
1
|
+
fastled/__init__.py,sha256=YrgAlORo0ezAxMNx3mGJa71YPAU04zTxhFX9yOShiow,6747
|
2
|
+
fastled/app.py,sha256=AidwEoWyQCrOyz30HvhtqESDo1uze23VmtTr-UHWZJc,3936
|
3
3
|
fastled/cli.py,sha256=FjVr31ht0UPlAcmX-84NwfAGMQHTkrCe4o744jCAxiw,375
|
4
4
|
fastled/client_server.py,sha256=Q_-ALIbp474gY1zkYHoaU36eVSIa87nRcSB6IZOoaCg,14315
|
5
5
|
fastled/compile_server.py,sha256=ul3eiZNX2wwmInooo3PJC3_kNpdejYVDIo94G3sV9HQ,2941
|
6
|
-
fastled/compile_server_impl.py,sha256=
|
7
|
-
fastled/docker_manager.py,sha256=
|
6
|
+
fastled/compile_server_impl.py,sha256=QPCzmSKoAm8rMftuvbxbojCAAcaazXSWFkjPv_UI7vk,9901
|
7
|
+
fastled/docker_manager.py,sha256=QRHMdXugaegwOgXix8I0yvkjq2vY3jG8jBbYjnCxLps,29921
|
8
8
|
fastled/filewatcher.py,sha256=XjFTo6NvEaosGTPr2Uhj91aqmtFdYHzJfxPzjBTMkKA,7086
|
9
|
-
fastled/interactive_srcs.py,sha256=
|
9
|
+
fastled/interactive_srcs.py,sha256=F5nHdJc60xsnmOtnKhngE9JytqGn56PmYw_MVSIX1ac,138
|
10
10
|
fastled/keyboard.py,sha256=vyYxE98WCXjvMpcUJd0YXPVvt7TzvBmifLYI-K7jtKg,3524
|
11
11
|
fastled/live_client.py,sha256=MDauol0mxtXggV1Pv9ahC0Jjg_4wnnV6FjGEtdd9cxU,2763
|
12
12
|
fastled/open_browser.py,sha256=KX2h9PUaPsKcwZ84i01DrXOnNpvaKLpB63u5kzcnEKQ,4342
|
13
13
|
fastled/open_browser2.py,sha256=jUgN81bEYX-sr0zKTVJkwj9tXEVq7aZTxGUP_ShyCbs,3614
|
14
|
-
fastled/parse_args.py,sha256=
|
14
|
+
fastled/parse_args.py,sha256=xgjxirQVX3FQxHZNVJtQQxTOeSJRQdGUNQ7W33Y880Y,8051
|
15
15
|
fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
|
16
16
|
fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
|
17
17
|
fastled/select_sketch_directory.py,sha256=TZdCjl1D7YMKjodMTvDRurPcpAmN3x0TcJxffER2NfM,1314
|
@@ -26,9 +26,9 @@ fastled/assets/example.txt,sha256=lTBovRjiz0_TgtAtbA1C5hNi2ffbqnNPqkKg6UiKCT8,54
|
|
26
26
|
fastled/site/build.py,sha256=l4RajIk0bApiAifT1lyLjIZi9lpPtSba4cnwWP5UOKc,14064
|
27
27
|
fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
|
28
28
|
fastled/test/examples.py,sha256=GfaHeY1E8izBl6ZqDVjz--RHLyVR4NRnQ5pBesCFJFY,1673
|
29
|
-
fastled-1.2.
|
30
|
-
fastled-1.2.
|
31
|
-
fastled-1.2.
|
32
|
-
fastled-1.2.
|
33
|
-
fastled-1.2.
|
34
|
-
fastled-1.2.
|
29
|
+
fastled-1.2.42.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
|
30
|
+
fastled-1.2.42.dist-info/METADATA,sha256=LptcuXR92sgrugDf_QEzO1X78SN3pjNkqHOFIRjtnzA,21264
|
31
|
+
fastled-1.2.42.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
32
|
+
fastled-1.2.42.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
|
33
|
+
fastled-1.2.42.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
|
34
|
+
fastled-1.2.42.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|