fastled 1.3.3__tar.gz → 1.3.6__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 (125) hide show
  1. {fastled-1.3.3 → fastled-1.3.6}/PKG-INFO +2 -2
  2. {fastled-1.3.3 → fastled-1.3.6}/compiler/pyproject.toml +1 -1
  3. {fastled-1.3.3 → fastled-1.3.6}/pyproject.toml +1 -1
  4. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/__version__.py +1 -1
  5. fastled-1.3.3/src/fastled/types.py → fastled-1.3.6/src/fastled/args.py +2 -75
  6. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/docker_manager.py +32 -0
  7. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/parse_args.py +15 -1
  8. fastled-1.3.6/src/fastled/types.py +77 -0
  9. {fastled-1.3.3 → fastled-1.3.6}/src/fastled.egg-info/PKG-INFO +2 -2
  10. {fastled-1.3.3 → fastled-1.3.6}/src/fastled.egg-info/SOURCES.txt +2 -1
  11. {fastled-1.3.3 → fastled-1.3.6}/src/fastled.egg-info/requires.txt +1 -1
  12. fastled-1.3.3/tests/unit/test_fetch_debug_source_files.py → fastled-1.3.6/tests/unit/test_debug_fetch_source_files.py +4 -2
  13. {fastled-1.3.3 → fastled-1.3.6}/.aiderignore +0 -0
  14. {fastled-1.3.3 → fastled-1.3.6}/.dockerignore +0 -0
  15. {fastled-1.3.3 → fastled-1.3.6}/.github/workflows/build_multi_docker_image.yml +0 -0
  16. {fastled-1.3.3 → fastled-1.3.6}/.github/workflows/build_webpage.yml +0 -0
  17. {fastled-1.3.3 → fastled-1.3.6}/.github/workflows/lint.yml +0 -0
  18. {fastled-1.3.3 → fastled-1.3.6}/.github/workflows/publish_release.yml +0 -0
  19. {fastled-1.3.3 → fastled-1.3.6}/.github/workflows/template_build_docker_image.yml +0 -0
  20. {fastled-1.3.3 → fastled-1.3.6}/.github/workflows/test_build_exe.yml +0 -0
  21. {fastled-1.3.3 → fastled-1.3.6}/.github/workflows/test_macos.yml +0 -0
  22. {fastled-1.3.3 → fastled-1.3.6}/.github/workflows/test_ubuntu.yml +0 -0
  23. {fastled-1.3.3 → fastled-1.3.6}/.github/workflows/test_win.yml +0 -0
  24. {fastled-1.3.3 → fastled-1.3.6}/.gitignore +0 -0
  25. {fastled-1.3.3 → fastled-1.3.6}/.pylintrc +0 -0
  26. {fastled-1.3.3 → fastled-1.3.6}/.vscode/launch.json +0 -0
  27. {fastled-1.3.3 → fastled-1.3.6}/.vscode/settings.json +0 -0
  28. {fastled-1.3.3 → fastled-1.3.6}/.vscode/tasks.json +0 -0
  29. {fastled-1.3.3 → fastled-1.3.6}/Dockerfile +0 -0
  30. {fastled-1.3.3 → fastled-1.3.6}/LICENSE +0 -0
  31. {fastled-1.3.3 → fastled-1.3.6}/MANIFEST.in +0 -0
  32. {fastled-1.3.3 → fastled-1.3.6}/README.md +0 -0
  33. {fastled-1.3.3 → fastled-1.3.6}/RELEASE.md +0 -0
  34. {fastled-1.3.3 → fastled-1.3.6}/TODO.md +0 -0
  35. {fastled-1.3.3 → fastled-1.3.6}/build_exe.py +0 -0
  36. {fastled-1.3.3 → fastled-1.3.6}/build_local_docker.py +0 -0
  37. {fastled-1.3.3 → fastled-1.3.6}/build_site.py +0 -0
  38. {fastled-1.3.3 → fastled-1.3.6}/clean +0 -0
  39. {fastled-1.3.3 → fastled-1.3.6}/compiler/CMakeLists.txt +0 -0
  40. {fastled-1.3.3 → fastled-1.3.6}/compiler/arduino-pre-process.sh +0 -0
  41. {fastled-1.3.3 → fastled-1.3.6}/compiler/debug.sh +0 -0
  42. {fastled-1.3.3 → fastled-1.3.6}/compiler/entrypoint.sh +0 -0
  43. {fastled-1.3.3 → fastled-1.3.6}/compiler/final_prewarm.sh +0 -0
  44. {fastled-1.3.3 → fastled-1.3.6}/compiler/init_runtime.py +0 -0
  45. {fastled-1.3.3 → fastled-1.3.6}/compiler/install-arduino-cli.sh +0 -0
  46. {fastled-1.3.3 → fastled-1.3.6}/compiler/libcompile/CMakeLists.txt +0 -0
  47. {fastled-1.3.3 → fastled-1.3.6}/compiler/prewarm.sh +0 -0
  48. {fastled-1.3.3 → fastled-1.3.6}/compiler/process-ino.py +0 -0
  49. {fastled-1.3.3 → fastled-1.3.6}/compiler/run.py +0 -0
  50. {fastled-1.3.3 → fastled-1.3.6}/demo/100dots.html +0 -0
  51. {fastled-1.3.3 → fastled-1.3.6}/demo/demo_threejs.html +0 -0
  52. {fastled-1.3.3 → fastled-1.3.6}/demo/micdemo.html +0 -0
  53. {fastled-1.3.3 → fastled-1.3.6}/demo/mp3upload.html +0 -0
  54. {fastled-1.3.3 → fastled-1.3.6}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
  55. {fastled-1.3.3 → fastled-1.3.6}/docker-compose.yml +0 -0
  56. {fastled-1.3.3 → fastled-1.3.6}/install +0 -0
  57. {fastled-1.3.3 → fastled-1.3.6}/install_linux.sh +0 -0
  58. {fastled-1.3.3 → fastled-1.3.6}/lint +0 -0
  59. {fastled-1.3.3 → fastled-1.3.6}/requirements.testing.txt +0 -0
  60. {fastled-1.3.3 → fastled-1.3.6}/setup.cfg +0 -0
  61. {fastled-1.3.3 → fastled-1.3.6}/setup.py +0 -0
  62. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/__init__.py +0 -0
  63. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/app.py +0 -0
  64. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/assets/example.txt +0 -0
  65. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/assets/localhost-key.pem +0 -0
  66. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/assets/localhost.pem +0 -0
  67. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/cli.py +0 -0
  68. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/cli_test.py +0 -0
  69. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/cli_test_interactive.py +0 -0
  70. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/client_server.py +0 -0
  71. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/compile_server.py +0 -0
  72. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/compile_server_impl.py +0 -0
  73. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/filewatcher.py +0 -0
  74. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/keyboard.py +0 -0
  75. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/keyz.py +0 -0
  76. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/live_client.py +0 -0
  77. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/open_browser.py +0 -0
  78. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/paths.py +0 -0
  79. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/print_filter.py +0 -0
  80. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/project_init.py +0 -0
  81. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/select_sketch_directory.py +0 -0
  82. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/server_flask.py +0 -0
  83. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/server_start.py +0 -0
  84. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/settings.py +0 -0
  85. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/site/build.py +0 -0
  86. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/site/examples.py +0 -0
  87. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/sketch.py +0 -0
  88. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/spinner.py +0 -0
  89. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/string_diff.py +0 -0
  90. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  91. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/test/examples.py +0 -0
  92. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/util.py +0 -0
  93. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/version.py +0 -0
  94. {fastled-1.3.3 → fastled-1.3.6}/src/fastled/web_compile.py +0 -0
  95. {fastled-1.3.3 → fastled-1.3.6}/src/fastled.egg-info/dependency_links.txt +0 -0
  96. {fastled-1.3.3 → fastled-1.3.6}/src/fastled.egg-info/entry_points.txt +0 -0
  97. {fastled-1.3.3 → fastled-1.3.6}/src/fastled.egg-info/top_level.txt +0 -0
  98. {fastled-1.3.3 → fastled-1.3.6}/test +0 -0
  99. {fastled-1.3.3 → fastled-1.3.6}/tests/integration/test_build_examples.py +0 -0
  100. {fastled-1.3.3 → fastled-1.3.6}/tests/integration/test_examples.py +0 -0
  101. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/html/index.html +0 -0
  102. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_api.py +0 -0
  103. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_bad_ino.py +0 -0
  104. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_cli.py +0 -0
  105. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_compile_server.py +0 -0
  106. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_docker_linux_on_windows.py +0 -0
  107. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_embedded_data.py +0 -0
  108. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_experimental_cpp_filter.py +0 -0
  109. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_filechanger.py +0 -0
  110. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_http_server.py +0 -0
  111. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_ino/bad/bad.ino +0 -0
  112. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
  113. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
  114. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
  115. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_ino/embedded/wasm.ino +0 -0
  116. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_ino/wasm/wasm.ino +0 -0
  117. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_print_filter.py +0 -0
  118. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_project_init.py +0 -0
  119. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_server_and_client_seperatly.py +0 -0
  120. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_string_diff.py +0 -0
  121. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_version.py +0 -0
  122. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_version_matches.py +0 -0
  123. {fastled-1.3.3 → fastled-1.3.6}/tests/unit/test_webcompile.py +0 -0
  124. {fastled-1.3.3 → fastled-1.3.6}/upload_package.sh +0 -0
  125. {fastled-1.3.3 → fastled-1.3.6}/vscode-plugin/readme +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.3.3
3
+ Version: 1.3.6
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
@@ -15,7 +15,7 @@ dependencies = [
15
15
  "disklru==2.0.0",
16
16
  "psutil==6.1.1",
17
17
  "wormhole-tx",
18
- "fastled-wasm-server>=1.0.25", # Also versions fastled-wasm-compiler dependency.
18
+ "fastled-wasm-server>=1.0.27", # Also versions fastled-wasm-compiler dependency.
19
19
  ]
20
20
 
21
21
  [tool.setuptools]
@@ -24,7 +24,7 @@ dependencies = [
24
24
  "Flask>=3.0.0",
25
25
  "livereload",
26
26
  ###### WASM SERVER ######
27
- "fastled-wasm-server>=1.0.25", # Enforced by unit test to match project <--> docker.
27
+ "fastled-wasm-server>=1.0.27", # Enforced by unit test to match project <--> docker.
28
28
  ]
29
29
 
30
30
  dynamic = ["version"]
@@ -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.6"
5
5
 
6
6
  __version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
@@ -1,10 +1,6 @@
1
1
  import argparse
2
2
  from dataclasses import dataclass
3
- from enum import Enum
4
3
  from pathlib import Path
5
- from typing import Any
6
-
7
- from fastled.print_filter import PrintFilterFastled
8
4
 
9
5
 
10
6
  @dataclass
@@ -25,6 +21,7 @@ class Args:
25
21
  debug: bool
26
22
  quick: bool
27
23
  release: bool
24
+ ram_disk_size: str # suffixed liked "25mb" or "1gb"
28
25
 
29
26
  @staticmethod
30
27
  def from_namespace(args: argparse.Namespace) -> "Args":
@@ -88,75 +85,5 @@ class Args:
88
85
  debug=args.debug,
89
86
  quick=args.quick,
90
87
  release=args.release,
88
+ ram_disk_size=args.ram_disk_size,
91
89
  )
92
-
93
-
94
- @dataclass
95
- class CompileResult:
96
- success: bool
97
- stdout: str
98
- hash_value: str | None
99
- zip_bytes: bytes
100
-
101
- def __bool__(self) -> bool:
102
- return self.success
103
-
104
- def to_dict(self) -> dict[str, Any]:
105
- return self.__dict__.copy()
106
-
107
- def __post_init__(self):
108
- # Filter the stdout.
109
- pf = PrintFilterFastled(echo=False)
110
- self.stdout = pf.print(self.stdout)
111
-
112
-
113
- class CompileServerError(Exception):
114
- """Error class for failing to instantiate CompileServer."""
115
-
116
- pass
117
-
118
-
119
- class BuildMode(Enum):
120
- DEBUG = "DEBUG"
121
- QUICK = "QUICK"
122
- RELEASE = "RELEASE"
123
-
124
- @classmethod
125
- def from_string(cls, mode_str: str) -> "BuildMode":
126
- try:
127
- return cls[mode_str.upper()]
128
- except KeyError:
129
- valid_modes = [mode.name for mode in cls]
130
- raise ValueError(f"BUILD_MODE must be one of {valid_modes}, got {mode_str}")
131
-
132
- @staticmethod
133
- def from_args(args: Args) -> "BuildMode":
134
- if args.debug:
135
- return BuildMode.DEBUG
136
- elif args.release:
137
- return BuildMode.RELEASE
138
- else:
139
- return BuildMode.QUICK
140
-
141
-
142
- class Platform(Enum):
143
- WASM = "WASM"
144
-
145
- @classmethod
146
- def from_string(cls, platform_str: str) -> "Platform":
147
- try:
148
- return cls[platform_str.upper()]
149
- except KeyError:
150
- valid_modes = [mode.name for mode in cls]
151
- raise ValueError(
152
- f"Platform must be one of {valid_modes}, got {platform_str}"
153
- )
154
-
155
-
156
- @dataclass
157
- class FileResponse:
158
- """File response from the server."""
159
-
160
- filename: str
161
- content: str
162
- mimetype: str
@@ -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,
@@ -3,6 +3,7 @@ import os
3
3
  import sys
4
4
  from pathlib import Path
5
5
 
6
+ from fastled.args import Args
6
7
  from fastled.project_init import project_init
7
8
  from fastled.select_sketch_directory import select_sketch_directory
8
9
  from fastled.settings import DEFAULT_URL, IMAGE_NAME
@@ -11,7 +12,6 @@ from fastled.sketch import (
11
12
  looks_like_fastled_repo,
12
13
  looks_like_sketch_directory,
13
14
  )
14
- from fastled.types import Args
15
15
 
16
16
 
17
17
  def _find_fastled_repo(start: Path) -> Path | None:
@@ -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
 
@@ -0,0 +1,77 @@
1
+ from dataclasses import dataclass
2
+ from enum import Enum
3
+ from typing import Any
4
+
5
+ from fastled.args import Args
6
+ from fastled.print_filter import PrintFilterFastled
7
+
8
+
9
+ @dataclass
10
+ class CompileResult:
11
+ success: bool
12
+ stdout: str
13
+ hash_value: str | None
14
+ zip_bytes: bytes
15
+
16
+ def __bool__(self) -> bool:
17
+ return self.success
18
+
19
+ def to_dict(self) -> dict[str, Any]:
20
+ return self.__dict__.copy()
21
+
22
+ def __post_init__(self):
23
+ # Filter the stdout.
24
+ pf = PrintFilterFastled(echo=False)
25
+ self.stdout = pf.print(self.stdout)
26
+
27
+
28
+ class CompileServerError(Exception):
29
+ """Error class for failing to instantiate CompileServer."""
30
+
31
+ pass
32
+
33
+
34
+ class BuildMode(Enum):
35
+ DEBUG = "DEBUG"
36
+ QUICK = "QUICK"
37
+ RELEASE = "RELEASE"
38
+
39
+ @classmethod
40
+ def from_string(cls, mode_str: str) -> "BuildMode":
41
+ try:
42
+ return cls[mode_str.upper()]
43
+ except KeyError:
44
+ valid_modes = [mode.name for mode in cls]
45
+ raise ValueError(f"BUILD_MODE must be one of {valid_modes}, got {mode_str}")
46
+
47
+ @staticmethod
48
+ def from_args(args: Args) -> "BuildMode":
49
+ if args.debug:
50
+ return BuildMode.DEBUG
51
+ elif args.release:
52
+ return BuildMode.RELEASE
53
+ else:
54
+ return BuildMode.QUICK
55
+
56
+
57
+ class Platform(Enum):
58
+ WASM = "WASM"
59
+
60
+ @classmethod
61
+ def from_string(cls, platform_str: str) -> "Platform":
62
+ try:
63
+ return cls[platform_str.upper()]
64
+ except KeyError:
65
+ valid_modes = [mode.name for mode in cls]
66
+ raise ValueError(
67
+ f"Platform must be one of {valid_modes}, got {platform_str}"
68
+ )
69
+
70
+
71
+ @dataclass
72
+ class FileResponse:
73
+ """File response from the server."""
74
+
75
+ filename: str
76
+ content: str
77
+ mimetype: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.3.3
3
+ Version: 1.3.6
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
@@ -53,6 +53,7 @@ demo/webgl_postprocessing_unreal_bloom.html
53
53
  src/fastled/__init__.py
54
54
  src/fastled/__version__.py
55
55
  src/fastled/app.py
56
+ src/fastled/args.py
56
57
  src/fastled/cli.py
57
58
  src/fastled/cli_test.py
58
59
  src/fastled/cli_test_interactive.py
@@ -99,10 +100,10 @@ tests/unit/test_api.py
99
100
  tests/unit/test_bad_ino.py
100
101
  tests/unit/test_cli.py
101
102
  tests/unit/test_compile_server.py
103
+ tests/unit/test_debug_fetch_source_files.py
102
104
  tests/unit/test_docker_linux_on_windows.py
103
105
  tests/unit/test_embedded_data.py
104
106
  tests/unit/test_experimental_cpp_filter.py
105
- tests/unit/test_fetch_debug_source_files.py
106
107
  tests/unit/test_filechanger.py
107
108
  tests/unit/test_http_server.py
108
109
  tests/unit/test_print_filter.py
@@ -8,4 +8,4 @@ progress>=1.6
8
8
  watchfiles>=1.0.5
9
9
  Flask>=3.0.0
10
10
  livereload
11
- fastled-wasm-server>=1.0.25
11
+ fastled-wasm-server>=1.0.27
@@ -111,14 +111,16 @@ class FetchSourceFileTester(unittest.TestCase):
111
111
  self.assertTrue(resp.status_code == 200, resp.status_code)
112
112
  content_length = int(resp.headers["Content-Length"])
113
113
  self.assertTrue(content_length > 0, "Content-Length is 0")
114
- backend_url = backend_host + "/dwarfsource/" + url.split("/")[-1]
114
+ backend_url = (
115
+ backend_host + "/dwarfsource/" + "/".join(url.split("/")[1:])
116
+ )
115
117
  resp = httpx.get(
116
118
  backend_url,
117
119
  timeout=100,
118
120
  )
119
121
  if resp.status_code != 200:
120
122
  raise Exception(
121
- f"Failed to fetch source file from the backend server: {resp.status_code}"
123
+ f"Failed to fetch source file '{backend_url}' from the backend server: {resp.status_code}"
122
124
  )
123
125
 
124
126
  print("Done")
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
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