fastled 1.3.3__py3-none-any.whl → 1.3.5__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/__version__.py CHANGED
@@ -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.3"
4
+ __version__ = "1.3.5"
5
5
 
6
6
  __version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
fastled/docker_manager.py CHANGED
@@ -33,6 +33,7 @@ CONFIG_DIR.mkdir(parents=True, exist_ok=True)
33
33
  DB_FILE = CONFIG_DIR / "db.db"
34
34
  DISK_CACHE = DiskLRUCache(str(DB_FILE), 10)
35
35
  _IS_GITHUB = "GITHUB_ACTIONS" in os.environ
36
+ _DEFAULT_BUILD_DIR = "/js/.pio/build"
36
37
 
37
38
 
38
39
  # Docker uses datetimes in UTC but without the timezone info. If we pass in a tz
@@ -42,6 +43,28 @@ def _utc_now_no_tz() -> datetime:
42
43
  return now.replace(tzinfo=None)
43
44
 
44
45
 
46
+ def set_ramdisk_size(size: str) -> None:
47
+ """Set the tmpfs size for the container."""
48
+ # This is a hack to set the tmpfs size from the environment variable.
49
+ # It should be set in the docker-compose.yml file.
50
+ # If not set, return 25MB.
51
+ try:
52
+ os.environ["TMPFS_SIZE"] = str(size)
53
+ except ValueError:
54
+ os.environ["TMPFS_SIZE"] = "0" # Defaults to off
55
+
56
+
57
+ def get_ramdisk_size() -> str | None:
58
+ """Get the tmpfs size for the container."""
59
+ # This is a hack to get the tmpfs size from the environment variable.
60
+ # It should be set in the docker-compose.yml file.
61
+ # If not set, return 25MB.
62
+ try:
63
+ return os.environ.get("TMPFS_SIZE", None)
64
+ except ValueError:
65
+ return None # Defaults to off
66
+
67
+
45
68
  def _win32_docker_location() -> str | None:
46
69
  home_dir = Path.home()
47
70
  out = [
@@ -594,6 +617,7 @@ class DockerManager:
594
617
  ports: dict[int, int] | None = None,
595
618
  remove_previous: bool = False,
596
619
  environment: dict[str, str] | None = None,
620
+ tmpfs_size: str | None = None, # suffixed like 25mb.
597
621
  ) -> Container:
598
622
  """
599
623
  Run a container from an image. If it already exists with matching config, start it.
@@ -604,6 +628,8 @@ class DockerManager:
604
628
  ports: Dict mapping host ports to container ports
605
629
  Example: {8080: 80} maps host port 8080 to container port 80
606
630
  """
631
+ tmpfs_size = tmpfs_size or get_ramdisk_size()
632
+ sys_admin = tmpfs_size is not None and tmpfs_size != "0"
607
633
  volumes = _hack_to_fix_mac(volumes)
608
634
  # Convert volumes to the format expected by Docker API
609
635
  volumes_dict = None
@@ -670,10 +696,16 @@ class DockerManager:
670
696
  print("\n" + "#" * msg_len)
671
697
  print(out_msg)
672
698
  print("#" * msg_len + "\n")
699
+
700
+ tmpfs: dict[str, str] | None = None
701
+ if tmpfs_size:
702
+ tmpfs = {_DEFAULT_BUILD_DIR: f"size={tmpfs_size}"}
673
703
  container = self.client.containers.run(
674
704
  image=image_name,
675
705
  command=command,
676
706
  name=container_name,
707
+ tmpfs=tmpfs,
708
+ cap_add=["SYS_ADMIN"] if sys_admin else None,
677
709
  detach=True,
678
710
  tty=True,
679
711
  volumes=volumes_dict,
fastled/parse_args.py CHANGED
@@ -78,6 +78,12 @@ def parse_args() -> Args:
78
78
  action="store_true",
79
79
  help="Just compile, skip opening the browser and watching for changes.",
80
80
  )
81
+ parser.add_argument(
82
+ "--ram-disk-size",
83
+ type=str,
84
+ default="0",
85
+ help="Set the size of the ramdisk for the docker container. Use suffixes like '25mb' or '1gb'.",
86
+ )
81
87
  parser.add_argument(
82
88
  "--web",
83
89
  "-w",
@@ -156,6 +162,14 @@ def parse_args() -> Args:
156
162
 
157
163
  args = parser.parse_args()
158
164
 
165
+ if args.ram_disk_size != "0":
166
+ from fastled.docker_manager import set_ramdisk_size
167
+ from fastled.util import banner_string
168
+
169
+ msg = banner_string(f"Setting tmpfs size to {args.ram_disk_size}")
170
+ print(msg)
171
+ set_ramdisk_size(args.ram_disk_size)
172
+
159
173
  if args.purge:
160
174
  from fastled.docker_manager import DockerManager
161
175
 
fastled/types.py CHANGED
@@ -25,6 +25,7 @@ class Args:
25
25
  debug: bool
26
26
  quick: bool
27
27
  release: bool
28
+ ram_disk_size: str # suffixed liked "25mb" or "1gb"
28
29
 
29
30
  @staticmethod
30
31
  def from_namespace(args: argparse.Namespace) -> "Args":
@@ -88,6 +89,7 @@ class Args:
88
89
  debug=args.debug,
89
90
  quick=args.quick,
90
91
  release=args.release,
92
+ ram_disk_size=args.ram_disk_size,
91
93
  )
92
94
 
93
95
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.3.3
3
+ Version: 1.3.5
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -20,7 +20,7 @@ Requires-Dist: progress>=1.6
20
20
  Requires-Dist: watchfiles>=1.0.5
21
21
  Requires-Dist: Flask>=3.0.0
22
22
  Requires-Dist: livereload
23
- Requires-Dist: fastled-wasm-server>=1.0.25
23
+ Requires-Dist: fastled-wasm-server>=1.0.27
24
24
  Dynamic: home-page
25
25
  Dynamic: license-file
26
26
  Dynamic: maintainer
@@ -1,5 +1,5 @@
1
1
  fastled/__init__.py,sha256=YLikXGRWKlKAqj7bpvGmJLejGTFF-FC1lv2z1jwRinA,6852
2
- fastled/__version__.py,sha256=fo92Jlm3mAbIQsRDibjNwlWY6pHOmbsGtSCn2n2BU0k,372
2
+ fastled/__version__.py,sha256=6xEse_JpiXmulItwNgtYrtiaPTafPLvqPwVUn5wjXJ8,372
3
3
  fastled/app.py,sha256=1N5Q486YccaWCRqnaI2F04ktL64NAVjAN6i4c-zgm1o,5818
4
4
  fastled/cli.py,sha256=5EBsb02ueFUjlgrlg0GMdj3e5nnHVhvofmYyQRaw8uM,565
5
5
  fastled/cli_test.py,sha256=qJB9yLRFR3OwOwdIWSQ0fQsWLnA37v5pDccufiP_hTs,512
@@ -7,13 +7,13 @@ fastled/cli_test_interactive.py,sha256=BjNhveZOk5aCffHbcrxPQQjWmAuj4ClVKKcKX5eY6
7
7
  fastled/client_server.py,sha256=falqUhGSHQpNfEXNCcQFPDAZymfncEVhIDcURBIJTFk,18390
8
8
  fastled/compile_server.py,sha256=rkXvrvdav5vDG8lv_OlBX3YSCHtnHMt25nXbfeg_r78,2960
9
9
  fastled/compile_server_impl.py,sha256=MIe-GvKenoDaqX8VhCJ7KNIWTOHHcLPgUQ7kO6lsa38,12199
10
- fastled/docker_manager.py,sha256=xtBGZUiz4UfFVik2eJYl6qD2BUGj4Jj6o-T0LY1iDYI,38052
10
+ fastled/docker_manager.py,sha256=OWAWfKrtJQU6joXZF9bnoLmh8T8U3dGq-obqBuNVY_8,39260
11
11
  fastled/filewatcher.py,sha256=3qS3L7zMQhFuVrkeGn1djsB_cB6x_E2YGJmmQWVAU_w,10033
12
12
  fastled/keyboard.py,sha256=UTAsqCn1UMYnB8YDzENiLTj4GeL45tYfEcO7_5fLFEg,3556
13
13
  fastled/keyz.py,sha256=LO-8m_7CpNDiZLM-FXhQ30f9gN1bUYz5lOsUPTIbI-c,4020
14
14
  fastled/live_client.py,sha256=yoAul8tVgbbPf1oEC79SUZSHkLECxlrXxgWR9XaBIp4,2957
15
15
  fastled/open_browser.py,sha256=DFyMrc1qic4Go7eLNPqMaLuMvTaE73NixdfSKV0yyp8,3709
16
- fastled/parse_args.py,sha256=tP8-AiVxEsZ5xvsL8YFfkd5L1whM3wzLS37IX2HCNrk,9454
16
+ fastled/parse_args.py,sha256=teSXmK4iHAxminn91bRe6ORC7fqhW0qhujSW1RuQOpk,9938
17
17
  fastled/paths.py,sha256=VsPmgu0lNSCFOoEC0BsTYzDygXqy15AHUfN-tTuzDZA,99
18
18
  fastled/print_filter.py,sha256=oomBjrouWNPCgJY2guCpljTijFvNKRBVbipDrxIsszA,7426
19
19
  fastled/project_init.py,sha256=bBt4DwmW5hZkm9ICt9Qk-0Nr_0JQM7icCgH5Iv-bCQs,3984
@@ -24,7 +24,7 @@ fastled/settings.py,sha256=dUVyJ8Mtprg0RwaS6oMWP8jBhr4C3R8fu4Hdx_Z1lCM,577
24
24
  fastled/sketch.py,sha256=Ftbh55Nt-p4hmPuPpj8Q9HrMzvnUazhoG_q9FHcxkns,3473
25
25
  fastled/spinner.py,sha256=VHxmvB92P0Z_zYxRajb5HiNmkHHvZ5dG7hKtZltzpcs,867
26
26
  fastled/string_diff.py,sha256=NbtYxvBFxTUdmTpMLizlgZj2ULJ-7etj72GBdWDTGws,2496
27
- fastled/types.py,sha256=k1j1y5h1zpRonp1mqRXy797mSbLqzf5K1QEgl8f27jQ,4822
27
+ fastled/types.py,sha256=flMIgJkud7S1GGWK_gfTPzq-0ESoemWtc_ktalVGuXw,4925
28
28
  fastled/util.py,sha256=hw3gxS1qGc5LL_QN88_VIjut6T0-61ImDQpxGp11DXY,1189
29
29
  fastled/version.py,sha256=TpBMiEVdO3_sUZEu6wmwN8Q4AgX2BiCxStCsnPKh6E0,1209
30
30
  fastled/web_compile.py,sha256=R159Od1VqeXTW6y3rQY0_P9f0CJYbPuBiMLqb-zBCUQ,11526
@@ -35,9 +35,9 @@ fastled/site/build.py,sha256=2YKU_UWKlJdGnjdbAbaL0co6kceFMSTVYwH1KCmgPZA,13987
35
35
  fastled/site/examples.py,sha256=s6vj2zJc6BfKlnbwXr1QWY1mzuDBMt6j5MEBOWjO_U8,155
36
36
  fastled/test/can_run_local_docker_tests.py,sha256=LEuUbHctRhNNFWcvnz2kEGmjDJeXO4c3kNpizm3yVJs,400
37
37
  fastled/test/examples.py,sha256=GfaHeY1E8izBl6ZqDVjz--RHLyVR4NRnQ5pBesCFJFY,1673
38
- fastled-1.3.3.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
39
- fastled-1.3.3.dist-info/METADATA,sha256=IkuFr7qUUMc4tgoPJIi-CcqN_Gj9h4J_IMzliYkBqoM,30049
40
- fastled-1.3.3.dist-info/WHEEL,sha256=QZxptf4Y1BKFRCEDxD4h2V0mBFQOVFLFEpvxHmIs52A,91
41
- fastled-1.3.3.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
42
- fastled-1.3.3.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
43
- fastled-1.3.3.dist-info/RECORD,,
38
+ fastled-1.3.5.dist-info/licenses/LICENSE,sha256=b6pOoifSXiUaz_lDS84vWlG3fr4yUKwB8fzkrH9R8bQ,1064
39
+ fastled-1.3.5.dist-info/METADATA,sha256=_Q-LspcjyjrIlaoUBtXD7IYtulZi92t49J2c6eX581c,30049
40
+ fastled-1.3.5.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
41
+ fastled-1.3.5.dist-info/entry_points.txt,sha256=RCwmzCSOS4-C2i9EziANq7Z2Zb4KFnEMR1FQC0bBwAw,101
42
+ fastled-1.3.5.dist-info/top_level.txt,sha256=Bbv5kpJpZhWNCvDF4K0VcvtBSDMa8B7PTOrZa9CezHY,8
43
+ fastled-1.3.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.6.0)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5