fastled 1.2.40__py3-none-any.whl → 1.2.41__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 CHANGED
@@ -3,11 +3,14 @@
3
3
  # context
4
4
  import shutil
5
5
  import subprocess
6
+ import tempfile
6
7
  from contextlib import contextmanager
7
8
  from multiprocessing import Process
8
9
  from pathlib import Path
9
10
  from typing import Generator
10
11
 
12
+ import httpx
13
+
11
14
  from .compile_server import CompileServer
12
15
  from .live_client import LiveClient
13
16
  from .site.build import build
@@ -16,7 +19,11 @@ from .types import BuildMode, CompileResult, CompileServerError
16
19
  # IMPORTANT! There's a bug in github which will REJECT any version update
17
20
  # that has any other change in the repo. Please bump the version as the
18
21
  # ONLY change in a commit, or else the pypi update and the release will fail.
19
- __version__ = "1.2.40"
22
+ __version__ = "1.2.41"
23
+
24
+ DOCKER_FILE = (
25
+ "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/Dockerfile"
26
+ )
20
27
 
21
28
 
22
29
  class Api:
@@ -222,36 +229,40 @@ class Docker:
222
229
  ["git", "clone", "--depth", "1", url, str(output_dir)], check=True
223
230
  )
224
231
 
225
- dockerfile_path = (
226
- output_dir / "src" / "platforms" / "wasm" / "compiler" / "Dockerfile"
227
- )
232
+ with tempfile.TemporaryDirectory() as tempdir:
233
+ dockerfiles_dst = Path(tempdir) / "Dockerfile"
234
+ # download the file and write it to dockerfiles_dst path
235
+ with open(dockerfiles_dst, "wb") as f:
236
+ with httpx.stream("GET", DOCKER_FILE) as response:
237
+ for chunk in response.iter_bytes():
238
+ f.write(chunk)
239
+
240
+ if not dockerfiles_dst.exists():
241
+ raise FileNotFoundError(
242
+ f"Dockerfile not found at {dockerfiles_dst}. "
243
+ "This may not be a valid FastLED repository."
244
+ )
228
245
 
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."
246
+ docker_mgr = DockerManager()
247
+
248
+ platform_tag = ""
249
+ # if "arm" in docker_mgr.architecture():
250
+ if (
251
+ "arm"
252
+ in subprocess.run(["uname", "-m"], capture_output=True).stdout.decode()
253
+ ):
254
+ platform_tag = "-arm64"
255
+
256
+ # Build the image
257
+ docker_mgr.build_image(
258
+ image_name=IMAGE_NAME,
259
+ tag="main",
260
+ dockerfile_path=dockerfiles_dst,
261
+ build_context=output_dir,
262
+ build_args={"NO_PREWARM": "1"},
263
+ platform_tag=platform_tag,
233
264
  )
234
265
 
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
266
  # # Run the container and return it
256
267
  # container = docker_mgr.run_container_detached(
257
268
  # image_name=IMAGE_NAME,
@@ -302,10 +313,13 @@ class Docker:
302
313
  if isinstance(project_root, str):
303
314
  project_root = Path(project_root)
304
315
 
305
- dockerfile_path = (
306
- project_root / "src" / "platforms" / "wasm" / "compiler" / "Dockerfile"
307
- )
316
+ if DockerManager.is_docker_installed() is False:
317
+ raise Exception("Docker is not installed.")
318
+
308
319
  docker_mgr = DockerManager()
320
+ if DockerManager.is_running() is False:
321
+ docker_mgr.start()
322
+
309
323
  platform_tag = ""
310
324
  # if "arm" in docker_mgr.architecture():
311
325
  if (
@@ -317,15 +331,24 @@ class Docker:
317
331
  # if image exists, remove it
318
332
  docker_mgr.purge(image_name=IMAGE_NAME)
319
333
 
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
- )
334
+ with tempfile.TemporaryDirectory() as tempdir:
335
+ dockerfile_dst = Path(tempdir) / "Dockerfile"
336
+
337
+ # download the file and write it to dockerfiles_dst path
338
+ with open(dockerfile_dst, "wb") as f:
339
+ with httpx.stream("GET", DOCKER_FILE) as response:
340
+ for chunk in response.iter_bytes():
341
+ f.write(chunk)
342
+
343
+ # Build the image
344
+ docker_mgr.build_image(
345
+ image_name=IMAGE_NAME,
346
+ tag="main",
347
+ dockerfile_path=dockerfile_dst,
348
+ build_context=project_root,
349
+ build_args={"NO_PREWARM": "1"},
350
+ platform_tag=platform_tag,
351
+ )
329
352
 
330
353
  out: CompileServer = CompileServer(
331
354
  container_name=CONTAINER_NAME,
@@ -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
- print(f"Error building Docker image: {rtn}")
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
 
@@ -1,5 +1,5 @@
1
1
  INTERACTIVE_SOURCES: list[str] = [
2
- "src/platforms/wasm/compiler/CMakeLists.txt",
3
- "src/platforms/wasm/compiler/build_archive.sh",
4
- "src/platforms/wasm/compiler/build.sh",
2
+ "/js/compiler/CMakeLists.txt",
3
+ "/js/compiler/build_archive.sh",
4
+ "/js/compiler/build.sh",
5
5
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fastled
3
- Version: 1.2.40
3
+ Version: 1.2.41
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,12 +1,12 @@
1
- fastled/__init__.py,sha256=Ha6cPWlT-RRMkKSUD-c5cAzd5BDh3nNn7R63jPIYCeQ,12847
1
+ fastled/__init__.py,sha256=3zpR2cQiWURhu56q_8wGqNj_kL_m7fORfnc3T4x-JHk,13851
2
2
  fastled/app.py,sha256=6EE7mRcKKFm1wTyvpk3zy6OtlbHovSlDGU8bSq-Pjws,3763
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=vCuy4RlMm1FTJ6Xp6eFjV84xLVtLpdCaStz0N7Bi3n8,9977
7
- fastled/docker_manager.py,sha256=cIxOSeHnDqrT5IWPP1sl1cF8XYy3sUNfoOE-JpuKr3U,29815
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=BZJ2IJNzUg4BuE_QWyD_y_xX978clY5CMzTSz8lvFcw,183
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
@@ -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.40.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
30
- fastled-1.2.40.dist-info/METADATA,sha256=j_9e9ixRE1iug38SmM1rwts7rtakFyeasDZ7UNSIDLw,21262
31
- fastled-1.2.40.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
32
- fastled-1.2.40.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
33
- fastled-1.2.40.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
34
- fastled-1.2.40.dist-info/RECORD,,
29
+ fastled-1.2.41.dist-info/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
30
+ fastled-1.2.41.dist-info/METADATA,sha256=ZscaHfPqTwVv19ihdqqO6799oW8Q3PN58j6hUEFbAsc,21264
31
+ fastled-1.2.41.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
32
+ fastled-1.2.41.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
33
+ fastled-1.2.41.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
34
+ fastled-1.2.41.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (75.8.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5