fastled 1.3.10__tar.gz → 1.3.13__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.13/Dockerfile +58 -0
- {fastled-1.3.10 → fastled-1.3.13}/PKG-INFO +4 -2
- {fastled-1.3.10 → fastled-1.3.13}/README.md +2 -0
- {fastled-1.3.10 → fastled-1.3.13}/clean +1 -0
- {fastled-1.3.10 → fastled-1.3.13}/compiler/run.py +7 -34
- {fastled-1.3.10 → fastled-1.3.13}/docker-compose.yml +1 -1
- {fastled-1.3.10/compiler → fastled-1.3.13}/entrypoint.sh +1 -4
- {fastled-1.3.10 → fastled-1.3.13}/pyproject.toml +1 -2
- {fastled-1.3.10 → fastled-1.3.13}/requirements.testing.txt +2 -1
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/__version__.py +1 -1
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/app.py +1 -6
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/args.py +1 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/cli.py +3 -4
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/compile_server_impl.py +0 -16
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/docker_manager.py +25 -1
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/parse_args.py +38 -11
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled.egg-info/PKG-INFO +4 -2
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled.egg-info/SOURCES.txt +1 -11
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled.egg-info/requires.txt +1 -1
- {fastled-1.3.10 → fastled-1.3.13}/test +2 -2
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_version.py +3 -2
- fastled-1.3.10/Dockerfile +0 -85
- fastled-1.3.10/compiler/CMakeLists.txt +0 -139
- fastled-1.3.10/compiler/arduino-pre-process.sh +0 -3
- fastled-1.3.10/compiler/final_prewarm.sh +0 -26
- fastled-1.3.10/compiler/init_runtime.py +0 -112
- fastled-1.3.10/compiler/install-arduino-cli.sh +0 -41
- fastled-1.3.10/compiler/libcompile/CMakeLists.txt +0 -152
- fastled-1.3.10/compiler/prewarm.sh +0 -42
- fastled-1.3.10/compiler/process-ino.py +0 -138
- fastled-1.3.10/compiler/pyproject.toml +0 -22
- fastled-1.3.10/tests/unit/test_version_matches.py +0 -70
- {fastled-1.3.10 → fastled-1.3.13}/.aiderignore +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.dockerignore +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.github/workflows/build_multi_docker_image.yml +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.github/workflows/build_webpage.yml +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.github/workflows/lint.yml +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.github/workflows/publish_release.yml +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.github/workflows/template_build_docker_image.yml +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.github/workflows/test_build_exe.yml +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.github/workflows/test_macos.yml +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.github/workflows/test_ubuntu.yml +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.github/workflows/test_win.yml +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.gitignore +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.pylintrc +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.vscode/launch.json +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.vscode/settings.json +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/.vscode/tasks.json +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/LICENSE +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/MANIFEST.in +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/RELEASE.md +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/TODO.md +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/build_exe.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/build_local_docker.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/build_site.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/compiler/debug.sh +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/demo/100dots.html +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/demo/demo_threejs.html +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/demo/micdemo.html +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/demo/mp3upload.html +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/demo/webgl_postprocessing_unreal_bloom.html +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/install +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/install_linux.sh +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/lint +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/setup.cfg +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/setup.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/__init__.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/assets/example.txt +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/assets/localhost-key.pem +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/assets/localhost.pem +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/cli_test.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/cli_test_interactive.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/client_server.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/compile_server.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/filewatcher.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/keyboard.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/keyz.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/live_client.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/open_browser.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/paths.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/print_filter.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/project_init.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/select_sketch_directory.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/server_flask.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/server_start.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/settings.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/site/build.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/site/examples.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/sketch.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/spinner.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/string_diff.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/test/can_run_local_docker_tests.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/test/examples.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/types.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/util.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/version.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled/web_compile.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled.egg-info/dependency_links.txt +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled.egg-info/entry_points.txt +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/src/fastled.egg-info/top_level.txt +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/integration/test_build_examples.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/integration/test_examples.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/html/index.html +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_api.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_bad_ino.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_cli.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_compile_server.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_debug_fetch_source_files.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_docker_linux_on_windows.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_embedded_data.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_experimental_cpp_filter.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_filechanger.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_http_server.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_ino/bad/bad.ino +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_ino/embedded/wasm.ino +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_ino/wasm/wasm.ino +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_print_filter.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_project_init.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_server_and_client_seperatly.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_string_diff.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/tests/unit/test_webcompile.py +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/upload_package.sh +0 -0
- {fastled-1.3.10 → fastled-1.3.13}/vscode-plugin/readme +0 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
|
2
|
+
# The only reason we use docker is because of the fastled-wasm-compiler.
|
3
|
+
FROM niteris/fastled-wasm-compiler:latest
|
4
|
+
|
5
|
+
|
6
|
+
COPY requirements.testing.txt /install/requirements.txt
|
7
|
+
# Extract fastled-wasm-server version from requirements.txt
|
8
|
+
RUN \
|
9
|
+
grep -oP '(?<=fastled-wasm-server[<>=!]=?)[^ \n#]+' /install/requirements.txt > /install/version.txt && \
|
10
|
+
cat /install/version.txt > /install/requirements.txt && \
|
11
|
+
uv pip install --system -r /install/requirements.txt --refresh || \
|
12
|
+
uv pip install --system -r /install/requirements.txt --refresh || \
|
13
|
+
uv pip install --system -r /install/requirements.txt --refresh
|
14
|
+
|
15
|
+
# FIRST PRE-WARM CYCLE and initial setup: Download the fastled repo from the github and pre-warm the cache with a compilation.
|
16
|
+
# This is by far the most expensive part of the build, because platformio needs to download initial tools. This
|
17
|
+
# pre-warm cycle is "sticky" and tends to stay in the cache for a long time since docker is very relaxed about
|
18
|
+
# invalidating cache layers that clone a github repo.
|
19
|
+
|
20
|
+
ARG FASTLED_BUILD_DAY=echo $(date +'%Y-%m-%d')
|
21
|
+
ENV FASTLED_BUILD_DAY=${FASTLED_BUILD_DAY}
|
22
|
+
|
23
|
+
|
24
|
+
WORKDIR /js
|
25
|
+
|
26
|
+
|
27
|
+
RUN mkdir -p /js/compiler
|
28
|
+
|
29
|
+
|
30
|
+
# COPY compiler/*.py /js/compiler
|
31
|
+
COPY entrypoint.sh /entrypoint.sh
|
32
|
+
COPY compiler/run.py /js/run.py
|
33
|
+
COPY compiler/debug.sh /js/debug.sh
|
34
|
+
|
35
|
+
# COPY compiler/entrypoint.sh /entrypoint.sh
|
36
|
+
# RUN chmod +x /entrypoint.sh && dos2unix /entrypoint.sh
|
37
|
+
|
38
|
+
RUN cd /js && chmod +x debug.sh && dos2unix *.sh
|
39
|
+
RUN chmod +x /entrypoint.sh && dos2unix /entrypoint.sh
|
40
|
+
|
41
|
+
# RSYNC DISABLED FOR NOW
|
42
|
+
# now sync local to the source directory.
|
43
|
+
# RUN rsync -av /host/fastled/ /js/fastled/ && rm -rf /host/fastled
|
44
|
+
|
45
|
+
# RUN python /js/init_runtime.py || true
|
46
|
+
|
47
|
+
|
48
|
+
# SECOND PRE-WARM CYCLE: Copy the fastled repo from the host machine and pre-warm the cache with that compilation. This will
|
49
|
+
# be much quicker than the first pre-warm cycle.
|
50
|
+
# RUN /js/prewarm.sh --force > /logs/prewarm.log.2 || true
|
51
|
+
|
52
|
+
# Now timestamp the image and store it at the end of the build.
|
53
|
+
RUN date > /image_timestamp.txt
|
54
|
+
|
55
|
+
ENTRYPOINT ["/entrypoint.sh"]
|
56
|
+
CMD ["python", "/js/run.py", "server"]
|
57
|
+
|
58
|
+
# CMD ["/bin/bash", "/entrypoint.sh"]
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.13
|
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:
|
23
|
+
Requires-Dist: disklru>=2.0.4
|
24
24
|
Dynamic: home-page
|
25
25
|
Dynamic: license-file
|
26
26
|
Dynamic: maintainer
|
@@ -389,12 +389,14 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
|
|
389
389
|
|
390
390
|
|
391
391
|
|
392
|
+
|
392
393
|
live-server --https --port=8416 --host=localhost . --cert=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost-key.pem --key=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost.pem --no-browser
|
393
394
|
|
394
395
|
|
395
396
|
live-server --https --cert=src/fastled/assets/localhost.pem --key=src/fastled/assets/localhost-key.pem --port=5500
|
396
397
|
|
397
398
|
|
399
|
+
|
398
400
|
## Performance
|
399
401
|
|
400
402
|
```
|
@@ -362,12 +362,14 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
|
|
362
362
|
|
363
363
|
|
364
364
|
|
365
|
+
|
365
366
|
live-server --https --port=8416 --host=localhost . --cert=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost-key.pem --key=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost.pem --no-browser
|
366
367
|
|
367
368
|
|
368
369
|
live-server --https --cert=src/fastled/assets/localhost.pem --key=src/fastled/assets/localhost-key.pem --port=5500
|
369
370
|
|
370
371
|
|
372
|
+
|
371
373
|
## Performance
|
372
374
|
|
373
375
|
```
|
@@ -6,8 +6,8 @@ import warnings
|
|
6
6
|
from pathlib import Path
|
7
7
|
from typing import Tuple
|
8
8
|
|
9
|
-
from
|
10
|
-
from
|
9
|
+
from fastled_wasm_compiler.compiler import Compiler
|
10
|
+
from fastled_wasm_compiler.paths import VOLUME_MAPPED_SRC
|
11
11
|
|
12
12
|
_PORT = os.environ.get("PORT", 80)
|
13
13
|
|
@@ -16,33 +16,6 @@ _CHOICES = ["compile", "server"]
|
|
16
16
|
HERE = Path(__file__).parent
|
17
17
|
|
18
18
|
|
19
|
-
def _update_fastled() -> None:
|
20
|
-
# NOT ENABLED YET
|
21
|
-
if True:
|
22
|
-
return
|
23
|
-
is_render = os.environ.get("RENDER", "false") == "true"
|
24
|
-
if not is_render:
|
25
|
-
print("Skipping finalprewarm...")
|
26
|
-
return
|
27
|
-
git_path = "/git/fastled"
|
28
|
-
fastled_path = "/js/fastled"
|
29
|
-
subprocess.run(["git", "fetch", "origin"], cwd=git_path)
|
30
|
-
subprocess.run(["git", "reset", "--hard", "origin/master"], cwd=git_path)
|
31
|
-
subprocess.run(
|
32
|
-
[
|
33
|
-
"rsync",
|
34
|
-
"-av",
|
35
|
-
"--info=NAME",
|
36
|
-
"--delete",
|
37
|
-
f"{git_path}/",
|
38
|
-
f"{fastled_path}/",
|
39
|
-
"--exclude",
|
40
|
-
".git",
|
41
|
-
],
|
42
|
-
cwd="/js",
|
43
|
-
)
|
44
|
-
|
45
|
-
|
46
19
|
def _parse_args() -> Tuple[argparse.Namespace, list[str]]:
|
47
20
|
parser = argparse.ArgumentParser(
|
48
21
|
description="Run compile.py with additional arguments"
|
@@ -102,16 +75,16 @@ def _run_compile(unknown_args: list[str]) -> int:
|
|
102
75
|
def main() -> int:
|
103
76
|
print("Running...")
|
104
77
|
args, unknown_args = _parse_args()
|
105
|
-
|
106
|
-
|
107
|
-
code_sync = CodeSync(
|
78
|
+
compiler = Compiler(
|
108
79
|
volume_mapped_src=VOLUME_MAPPED_SRC,
|
109
|
-
rsync_dest=Path("/invalid/path"),
|
110
80
|
)
|
111
|
-
|
81
|
+
compiler.update_src()
|
112
82
|
|
113
83
|
try:
|
114
84
|
if args.mode == "compile":
|
85
|
+
warnings.warn(
|
86
|
+
"The compile mode is deprecated and may fail. Use server mode instead."
|
87
|
+
)
|
115
88
|
rtn = _run_compile(unknown_args)
|
116
89
|
return rtn
|
117
90
|
elif args.mode == "server":
|
@@ -4,12 +4,9 @@
|
|
4
4
|
source /emsdk/emsdk_env.sh
|
5
5
|
export PATH="$PATH:/emsdk/upstream/bin"
|
6
6
|
|
7
|
-
# initialize runtime
|
8
|
-
python init_runtime.py
|
9
|
-
|
10
7
|
# only do the final prewarm if RUNTIME_PREWARM is set to "1"
|
11
8
|
if [[ "${RUNTIME_PREWARM:-0}" == "1" ]]; then
|
12
|
-
|
9
|
+
uv run -m fastled_wasm_compiler.cli_update_from_master
|
13
10
|
fi
|
14
11
|
|
15
12
|
# hand off to the main command
|
@@ -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.13"
|
5
5
|
|
6
6
|
__version_url_latest__ = "https://raw.githubusercontent.com/zackees/fastled-wasm/refs/heads/main/src/fastled/__version__.py"
|
@@ -2,6 +2,7 @@
|
|
2
2
|
Uses the latest wasm compiler image to compile the FastLED sketch.
|
3
3
|
"""
|
4
4
|
|
5
|
+
import os
|
5
6
|
import sys
|
6
7
|
import time
|
7
8
|
from pathlib import Path
|
@@ -12,12 +13,6 @@ from fastled.filewatcher import file_watcher_set
|
|
12
13
|
from fastled.parse_args import Args, parse_args
|
13
14
|
from fastled.sketch import find_sketch_directories, looks_like_fastled_repo
|
14
15
|
|
15
|
-
# from fastled.sketch import (
|
16
|
-
# find_sketch_directories,
|
17
|
-
# looks_like_fastled_repo,
|
18
|
-
# looks_like_sketch_directory,
|
19
|
-
# )
|
20
|
-
|
21
16
|
|
22
17
|
def run_server(args: Args) -> int:
|
23
18
|
interactive = args.interactive
|
@@ -3,7 +3,6 @@ Main entry point.
|
|
3
3
|
"""
|
4
4
|
|
5
5
|
import multiprocessing
|
6
|
-
import os
|
7
6
|
import sys
|
8
7
|
|
9
8
|
|
@@ -16,9 +15,9 @@ def run_app() -> int:
|
|
16
15
|
|
17
16
|
def main() -> int:
|
18
17
|
"""Main entry point for the template_python_cmd package."""
|
19
|
-
if "--debug" in sys.argv:
|
20
|
-
|
21
|
-
|
18
|
+
# if "--debug" in sys.argv:
|
19
|
+
# # Debug mode
|
20
|
+
# os.environ["FLASK_SERVER_LOGGING"] = "1"
|
22
21
|
return run_app()
|
23
22
|
|
24
23
|
|
@@ -249,22 +249,6 @@ class CompileServerImpl:
|
|
249
249
|
# to allow for interactive compilation
|
250
250
|
# interactive_sources = list(INTERACTIVE_SOURCES)
|
251
251
|
interactive_sources: list[tuple[Path, str]] = []
|
252
|
-
init_runtime_py = (
|
253
|
-
Path(self.fastled_src_dir)
|
254
|
-
/ ".."
|
255
|
-
/ ".."
|
256
|
-
/ "fastled-wasm"
|
257
|
-
/ "compiler"
|
258
|
-
/ "init_runtime.py"
|
259
|
-
)
|
260
|
-
if init_runtime_py.exists():
|
261
|
-
# fastled-wasm is in a sister directory, mapping this in to the container.
|
262
|
-
mapping = (
|
263
|
-
init_runtime_py,
|
264
|
-
"/js/init_runtime.py",
|
265
|
-
)
|
266
|
-
interactive_sources.append(mapping)
|
267
|
-
|
268
252
|
src_host: Path
|
269
253
|
dst_container: str
|
270
254
|
for src_host, dst_container in interactive_sources:
|
@@ -36,7 +36,7 @@ _IS_GITHUB = "GITHUB_ACTIONS" in os.environ
|
|
36
36
|
_DEFAULT_BUILD_DIR = "/js/.pio/build"
|
37
37
|
|
38
38
|
|
39
|
-
os.environ.get("FASTLED_FORCE_CLEAR", "0") == "1"
|
39
|
+
FORCE_CLEAR: bool = bool(os.environ.get("FASTLED_FORCE_CLEAR", "0") == "1")
|
40
40
|
|
41
41
|
|
42
42
|
# Docker uses datetimes in UTC but without the timezone info. If we pass in a tz
|
@@ -68,6 +68,11 @@ def get_ramdisk_size() -> str | None:
|
|
68
68
|
return None # Defaults to off
|
69
69
|
|
70
70
|
|
71
|
+
def get_force_remove_image_previous() -> bool:
|
72
|
+
"""Get the force remove image previous value."""
|
73
|
+
return os.environ.get("FASTLED_FORCE_CLEAR", "0") == "1"
|
74
|
+
|
75
|
+
|
71
76
|
def set_clear() -> None:
|
72
77
|
os.environ["FASTLED_FORCE_CLEAR"] = "1"
|
73
78
|
|
@@ -218,6 +223,18 @@ def _hack_to_fix_mac(volumes: list[Volume] | None) -> list[Volume] | None:
|
|
218
223
|
return volumes
|
219
224
|
|
220
225
|
|
226
|
+
def set_force_remove_image_previous(new_value: str | None = None) -> None:
|
227
|
+
if new_value is not None:
|
228
|
+
os.environ["FASTLED_FORCE_CLEAR"] = new_value
|
229
|
+
else:
|
230
|
+
os.environ["FASTLED_FORCE_CLEAR"] = "1"
|
231
|
+
|
232
|
+
|
233
|
+
def force_image_removal() -> bool:
|
234
|
+
"""Get the force remove image previous value."""
|
235
|
+
return os.environ.get("FASTLED_FORCE_CLEAR", "0") == "1"
|
236
|
+
|
237
|
+
|
221
238
|
class DockerManager:
|
222
239
|
def __init__(self) -> None:
|
223
240
|
from docker.errors import DockerException
|
@@ -635,6 +652,13 @@ class DockerManager:
|
|
635
652
|
ports: Dict mapping host ports to container ports
|
636
653
|
Example: {8080: 80} maps host port 8080 to container port 80
|
637
654
|
"""
|
655
|
+
remove_previous = remove_previous or get_force_remove_image_previous()
|
656
|
+
if get_force_remove_image_previous():
|
657
|
+
# make a banner print
|
658
|
+
print(
|
659
|
+
"Force removing previous image due to FASTLED_FORCE_CLEAR environment variable."
|
660
|
+
)
|
661
|
+
|
638
662
|
tmpfs_size = tmpfs_size or get_ramdisk_size()
|
639
663
|
sys_admin = tmpfs_size is not None and tmpfs_size != "0"
|
640
664
|
volumes = _hack_to_fix_mac(volumes)
|
@@ -146,12 +146,17 @@ def parse_args() -> Args:
|
|
146
146
|
help="Remove all FastLED containers and images",
|
147
147
|
)
|
148
148
|
|
149
|
+
parser.add_argument(
|
150
|
+
"--clear",
|
151
|
+
action="store_true",
|
152
|
+
help="Remove all FastLED containers and images",
|
153
|
+
)
|
154
|
+
|
149
155
|
build_mode = parser.add_mutually_exclusive_group()
|
150
156
|
build_mode.add_argument("--debug", action="store_true", help="Build in debug mode")
|
151
157
|
build_mode.add_argument(
|
152
158
|
"--quick",
|
153
159
|
action="store_true",
|
154
|
-
default=True,
|
155
160
|
help="Build in quick mode (default)",
|
156
161
|
)
|
157
162
|
build_mode.add_argument(
|
@@ -162,13 +167,24 @@ def parse_args() -> Args:
|
|
162
167
|
|
163
168
|
args = parser.parse_args()
|
164
169
|
|
165
|
-
|
166
|
-
|
167
|
-
from fastled.util import banner_string
|
170
|
+
# TODO: propagate the library.
|
171
|
+
# from fastled.docker_manager import force_remove_previous
|
168
172
|
|
169
|
-
|
170
|
-
|
171
|
-
|
173
|
+
# if force_remove_previous():
|
174
|
+
# print("Removing previous containers...")
|
175
|
+
# do itinfront he camer
|
176
|
+
# nonw invoke via the
|
177
|
+
#
|
178
|
+
# Work in progress.
|
179
|
+
# set_ramdisk_size("50mb")
|
180
|
+
|
181
|
+
# if args.ram_disk_size != "0":
|
182
|
+
# from fastled.docker_manager import set_ramdisk_size
|
183
|
+
# from fastled.util import banner_string
|
184
|
+
|
185
|
+
# msg = banner_string(f"Setting tmpfs size to {args.ram_disk_size}")
|
186
|
+
# print(msg)
|
187
|
+
# set_ramdisk_size(args.ram_disk_size)
|
172
188
|
|
173
189
|
if args.purge:
|
174
190
|
from fastled.docker_manager import DockerManager
|
@@ -188,15 +204,26 @@ def parse_args() -> Args:
|
|
188
204
|
print(f"Use 'fastled {args.directory}' to compile the project.")
|
189
205
|
sys.exit(0)
|
190
206
|
|
207
|
+
cwd: Path = Path(os.getcwd())
|
208
|
+
fastled_dir: Path | None = _find_fastled_repo(cwd)
|
209
|
+
is_fastled_dir: bool = fastled_dir is not None
|
210
|
+
|
211
|
+
if not (args.debug or args.quick or args.release):
|
212
|
+
if is_fastled_dir:
|
213
|
+
# if --quick, --debug, --release are not specified then default to --debug
|
214
|
+
args.quick = True
|
215
|
+
print("Defaulting to --quick mode in fastled repo")
|
216
|
+
else:
|
217
|
+
args.quick = True
|
218
|
+
print("Defaulting to --quick mode")
|
219
|
+
|
191
220
|
if args.build or args.interactive:
|
192
|
-
cwd: Path = Path(os.getcwd())
|
193
|
-
fastled_dir: Path | None = _find_fastled_repo(cwd)
|
194
221
|
if args.directory is not None:
|
195
222
|
args.directory = str(Path(args.directory).absolute())
|
196
|
-
if
|
223
|
+
if not is_fastled_dir:
|
197
224
|
print("This command must be run from within the FastLED repo. Exiting...")
|
198
225
|
sys.exit(1)
|
199
|
-
if cwd != fastled_dir:
|
226
|
+
if cwd != fastled_dir and fastled_dir is not None:
|
200
227
|
print(f"Switching to FastLED repo at {fastled_dir}")
|
201
228
|
os.chdir(fastled_dir)
|
202
229
|
if args.directory is None:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: fastled
|
3
|
-
Version: 1.3.
|
3
|
+
Version: 1.3.13
|
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:
|
23
|
+
Requires-Dist: disklru>=2.0.4
|
24
24
|
Dynamic: home-page
|
25
25
|
Dynamic: license-file
|
26
26
|
Dynamic: maintainer
|
@@ -389,12 +389,14 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
|
|
389
389
|
|
390
390
|
|
391
391
|
|
392
|
+
|
392
393
|
live-server --https --port=8416 --host=localhost . --cert=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost-key.pem --key=C:/Users/niteris/dev/fastled-wasm/src/fastled/assets/localhost.pem --no-browser
|
393
394
|
|
394
395
|
|
395
396
|
live-server --https --cert=src/fastled/assets/localhost.pem --key=src/fastled/assets/localhost-key.pem --port=5500
|
396
397
|
|
397
398
|
|
399
|
+
|
398
400
|
## Performance
|
399
401
|
|
400
402
|
```
|
@@ -13,6 +13,7 @@ build_local_docker.py
|
|
13
13
|
build_site.py
|
14
14
|
clean
|
15
15
|
docker-compose.yml
|
16
|
+
entrypoint.sh
|
16
17
|
install
|
17
18
|
install_linux.sh
|
18
19
|
lint
|
@@ -33,18 +34,8 @@ upload_package.sh
|
|
33
34
|
.vscode/launch.json
|
34
35
|
.vscode/settings.json
|
35
36
|
.vscode/tasks.json
|
36
|
-
compiler/CMakeLists.txt
|
37
|
-
compiler/arduino-pre-process.sh
|
38
37
|
compiler/debug.sh
|
39
|
-
compiler/entrypoint.sh
|
40
|
-
compiler/final_prewarm.sh
|
41
|
-
compiler/init_runtime.py
|
42
|
-
compiler/install-arduino-cli.sh
|
43
|
-
compiler/prewarm.sh
|
44
|
-
compiler/process-ino.py
|
45
|
-
compiler/pyproject.toml
|
46
38
|
compiler/run.py
|
47
|
-
compiler/libcompile/CMakeLists.txt
|
48
39
|
demo/100dots.html
|
49
40
|
demo/demo_threejs.html
|
50
41
|
demo/micdemo.html
|
@@ -111,7 +102,6 @@ tests/unit/test_project_init.py
|
|
111
102
|
tests/unit/test_server_and_client_seperatly.py
|
112
103
|
tests/unit/test_string_diff.py
|
113
104
|
tests/unit/test_version.py
|
114
|
-
tests/unit/test_version_matches.py
|
115
105
|
tests/unit/test_webcompile.py
|
116
106
|
tests/unit/html/index.html
|
117
107
|
tests/unit/test_ino/bad/bad.ino
|
@@ -16,10 +16,11 @@ class MainTester(unittest.TestCase):
|
|
16
16
|
def test_command(self) -> None:
|
17
17
|
"""Test command line interface (CLI)."""
|
18
18
|
stdout = subprocess.check_output(COMMAND, shell=True)
|
19
|
+
version_stdout = stdout.decode("utf-8").strip()
|
19
20
|
self.assertEqual(
|
20
|
-
|
21
|
+
version_stdout,
|
21
22
|
__version__,
|
22
|
-
f"Version mismatch: {
|
23
|
+
f"FastLED Version mismatch: {version_stdout} (tool output) != {__version__} (package version)",
|
23
24
|
)
|
24
25
|
|
25
26
|
|
fastled-1.3.10/Dockerfile
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
|
2
|
-
# The only reason we use docker is because of the fastled-wasm-compiler.
|
3
|
-
FROM niteris/fastled-wasm-compiler:latest
|
4
|
-
|
5
|
-
|
6
|
-
# Get the compiler requirements and install them.
|
7
|
-
COPY compiler/pyproject.toml /install/pyproject.toml
|
8
|
-
RUN uv pip install --system -r /install/pyproject.toml
|
9
|
-
|
10
|
-
# FIRST PRE-WARM CYCLE and initial setup: Download the fastled repo from the github and pre-warm the cache with a compilation.
|
11
|
-
# This is by far the most expensive part of the build, because platformio needs to download initial tools. This
|
12
|
-
# pre-warm cycle is "sticky" and tends to stay in the cache for a long time since docker is very relaxed about
|
13
|
-
# invalidating cache layers that clone a github repo.
|
14
|
-
|
15
|
-
RUN echo "force update4"
|
16
|
-
ARG FASTLED_BUILD_DAY=echo $(date +'%Y-%m-%d')
|
17
|
-
ENV FASTLED_BUILD_DAY=${FASTLED_BUILD_DAY}
|
18
|
-
|
19
|
-
# ARG FASTLED_VERSION=master
|
20
|
-
# ENV FASTLED_VERSION=${FASTLED_VERSION}
|
21
|
-
# RUN mkdir -p /js/fastled && \
|
22
|
-
# rsync -a /git/fastled/ /js/fastled/ --exclude='.git'
|
23
|
-
|
24
|
-
# Create symlinks for wasm platform files.
|
25
|
-
COPY compiler/init_runtime.py /js/init_runtime.py
|
26
|
-
#COPY compiler/prewarm.sh /js/prewarm.sh
|
27
|
-
|
28
|
-
WORKDIR /js
|
29
|
-
|
30
|
-
#ARG NO_PREWARM=0
|
31
|
-
#ENV NO_PREWARM=${NO_PREWARM}
|
32
|
-
|
33
|
-
#RUN python /js/init_runtime.py || true
|
34
|
-
|
35
|
-
|
36
|
-
# First pre-warm cycle - always do it as part of the build.
|
37
|
-
# RUN mkdir -p /logs
|
38
|
-
|
39
|
-
# Force a build if the compiler flags change.
|
40
|
-
#COPY compiler/CMakeLists.txt /trash/CMakeLists.txt
|
41
|
-
#RUN rm -rf /trash
|
42
|
-
|
43
|
-
#RUN chmod +x /js/prewarm.sh && \
|
44
|
-
# cat /js/prewarm.sh >> /logs/prewarm.log.0
|
45
|
-
#RUN /js/prewarm.sh --force >> /logs/prewarm.log.1 || true
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
# # Copy the fastled repo from the host machine and prepare for pre-warm
|
50
|
-
# # Make sure and delete files that have been removed so that we don't get
|
51
|
-
# # duplicate symbols from stale files.
|
52
|
-
# COPY *.json /host/fastled/
|
53
|
-
# COPY src/*.* /host/fastled/src/
|
54
|
-
# COPY examples /host/fastled/examples
|
55
|
-
# COPY src/fx /host/fastled/src/fx
|
56
|
-
# COPY src/fl /host/fastled/src/fl
|
57
|
-
# COPY src/lib8tion /host/fastled/src/lib8tion
|
58
|
-
# COPY src/third_party /host/fastled/src/third_party
|
59
|
-
# COPY src/sensors /host/fastled/src/sensors
|
60
|
-
# COPY src/platforms /host/fastled/src/platforms
|
61
|
-
|
62
|
-
RUN echo "force update"
|
63
|
-
COPY compiler /js/compiler
|
64
|
-
|
65
|
-
COPY compiler/entrypoint.sh /entrypoint.sh
|
66
|
-
RUN chmod +x /entrypoint.sh && dos2unix /entrypoint.sh
|
67
|
-
|
68
|
-
# RSYNC DISABLED FOR NOW
|
69
|
-
# now sync local to the source directory.
|
70
|
-
# RUN rsync -av /host/fastled/ /js/fastled/ && rm -rf /host/fastled
|
71
|
-
|
72
|
-
# RUN python /js/init_runtime.py || true
|
73
|
-
|
74
|
-
|
75
|
-
# SECOND PRE-WARM CYCLE: Copy the fastled repo from the host machine and pre-warm the cache with that compilation. This will
|
76
|
-
# be much quicker than the first pre-warm cycle.
|
77
|
-
# RUN /js/prewarm.sh --force > /logs/prewarm.log.2 || true
|
78
|
-
|
79
|
-
# Now timestamp the image and store it at the end of the build.
|
80
|
-
RUN date > /image_timestamp.txt
|
81
|
-
|
82
|
-
ENTRYPOINT ["/entrypoint.sh"]
|
83
|
-
CMD ["python", "/js/run.py", "server"]
|
84
|
-
|
85
|
-
# CMD ["/bin/bash", "/entrypoint.sh"]
|