fastled 1.2.82__tar.gz → 1.2.83__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 (131) hide show
  1. {fastled-1.2.82 → fastled-1.2.83}/PKG-INFO +1 -1
  2. {fastled-1.2.82 → fastled-1.2.83}/compiler/server.py +2 -2
  3. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/__init__.py +1 -1
  4. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/server_flask.py +66 -11
  5. {fastled-1.2.82 → fastled-1.2.83}/src/fastled.egg-info/PKG-INFO +1 -1
  6. {fastled-1.2.82 → fastled-1.2.83}/src/fastled.egg-info/SOURCES.txt +1 -1
  7. fastled-1.2.82/tests/unit/test_fastled_source_get.py → fastled-1.2.83/tests/unit/test_fetch_source_files.py +10 -1
  8. {fastled-1.2.82 → fastled-1.2.83}/.aiderignore +0 -0
  9. {fastled-1.2.82 → fastled-1.2.83}/.dockerignore +0 -0
  10. {fastled-1.2.82 → fastled-1.2.83}/.github/workflows/build_multi_docker_image.yml +0 -0
  11. {fastled-1.2.82 → fastled-1.2.83}/.github/workflows/build_webpage.yml +0 -0
  12. {fastled-1.2.82 → fastled-1.2.83}/.github/workflows/lint.yml +0 -0
  13. {fastled-1.2.82 → fastled-1.2.83}/.github/workflows/publish_release.yml +0 -0
  14. {fastled-1.2.82 → fastled-1.2.83}/.github/workflows/template_build_docker_image.yml +0 -0
  15. {fastled-1.2.82 → fastled-1.2.83}/.github/workflows/test_build_exe.yml +0 -0
  16. {fastled-1.2.82 → fastled-1.2.83}/.github/workflows/test_macos.yml +0 -0
  17. {fastled-1.2.82 → fastled-1.2.83}/.github/workflows/test_ubuntu.yml +0 -0
  18. {fastled-1.2.82 → fastled-1.2.83}/.github/workflows/test_win.yml +0 -0
  19. {fastled-1.2.82 → fastled-1.2.83}/.gitignore +0 -0
  20. {fastled-1.2.82 → fastled-1.2.83}/.pylintrc +0 -0
  21. {fastled-1.2.82 → fastled-1.2.83}/.vscode/launch.json +0 -0
  22. {fastled-1.2.82 → fastled-1.2.83}/.vscode/settings.json +0 -0
  23. {fastled-1.2.82 → fastled-1.2.83}/.vscode/tasks.json +0 -0
  24. {fastled-1.2.82 → fastled-1.2.83}/Dockerfile +0 -0
  25. {fastled-1.2.82 → fastled-1.2.83}/LICENSE +0 -0
  26. {fastled-1.2.82 → fastled-1.2.83}/MANIFEST.in +0 -0
  27. {fastled-1.2.82 → fastled-1.2.83}/README.md +0 -0
  28. {fastled-1.2.82 → fastled-1.2.83}/RELEASE.md +0 -0
  29. {fastled-1.2.82 → fastled-1.2.83}/TODO.md +0 -0
  30. {fastled-1.2.82 → fastled-1.2.83}/build_exe.py +0 -0
  31. {fastled-1.2.82 → fastled-1.2.83}/build_site.py +0 -0
  32. {fastled-1.2.82 → fastled-1.2.83}/clean +0 -0
  33. {fastled-1.2.82 → fastled-1.2.83}/compiler/CMakeLists.txt +0 -0
  34. {fastled-1.2.82 → fastled-1.2.83}/compiler/__init__.py +0 -0
  35. {fastled-1.2.82 → fastled-1.2.83}/compiler/arduino-pre-process.sh +0 -0
  36. {fastled-1.2.82 → fastled-1.2.83}/compiler/build.sh +0 -0
  37. {fastled-1.2.82 → fastled-1.2.83}/compiler/build_archive.sh +0 -0
  38. {fastled-1.2.82 → fastled-1.2.83}/compiler/build_fast.sh +0 -0
  39. {fastled-1.2.82 → fastled-1.2.83}/compiler/code_sync.py +0 -0
  40. {fastled-1.2.82 → fastled-1.2.83}/compiler/compile.py +0 -0
  41. {fastled-1.2.82 → fastled-1.2.83}/compiler/compile_lock.py +0 -0
  42. {fastled-1.2.82 → fastled-1.2.83}/compiler/debug.sh +0 -0
  43. {fastled-1.2.82 → fastled-1.2.83}/compiler/entrypoint.sh +0 -0
  44. {fastled-1.2.82 → fastled-1.2.83}/compiler/extra/100dots.html +0 -0
  45. {fastled-1.2.82 → fastled-1.2.83}/compiler/extra/demo_threejs.html +0 -0
  46. {fastled-1.2.82 → fastled-1.2.83}/compiler/extra/micdemo.html +0 -0
  47. {fastled-1.2.82 → fastled-1.2.83}/compiler/extra/mp3upload.html +0 -0
  48. {fastled-1.2.82 → fastled-1.2.83}/compiler/extra/webgl_postprocessing_unreal_bloom.html +0 -0
  49. {fastled-1.2.82 → fastled-1.2.83}/compiler/final_prewarm.sh +0 -0
  50. {fastled-1.2.82 → fastled-1.2.83}/compiler/init_runtime.py +0 -0
  51. {fastled-1.2.82 → fastled-1.2.83}/compiler/install-arduino-cli.sh +0 -0
  52. {fastled-1.2.82 → fastled-1.2.83}/compiler/libcompile/CMakeLists.txt +0 -0
  53. {fastled-1.2.82 → fastled-1.2.83}/compiler/paths.py +0 -0
  54. {fastled-1.2.82 → fastled-1.2.83}/compiler/pre-process.sh +0 -0
  55. {fastled-1.2.82 → fastled-1.2.83}/compiler/prewarm.sh +0 -0
  56. {fastled-1.2.82 → fastled-1.2.83}/compiler/process-ino.py +0 -0
  57. {fastled-1.2.82 → fastled-1.2.83}/compiler/process_extended.py +0 -0
  58. {fastled-1.2.82 → fastled-1.2.83}/compiler/pyproject.toml +0 -0
  59. {fastled-1.2.82 → fastled-1.2.83}/compiler/run.py +0 -0
  60. {fastled-1.2.82 → fastled-1.2.83}/compiler/sketch_hasher.py +0 -0
  61. {fastled-1.2.82 → fastled-1.2.83}/compiler/wasm_compiler_flags.py +0 -0
  62. {fastled-1.2.82 → fastled-1.2.83}/docker-compose.yml +0 -0
  63. {fastled-1.2.82 → fastled-1.2.83}/install +0 -0
  64. {fastled-1.2.82 → fastled-1.2.83}/install_linux.sh +0 -0
  65. {fastled-1.2.82 → fastled-1.2.83}/lint +0 -0
  66. {fastled-1.2.82 → fastled-1.2.83}/pyproject.toml +0 -0
  67. {fastled-1.2.82 → fastled-1.2.83}/requirements.testing.txt +0 -0
  68. {fastled-1.2.82 → fastled-1.2.83}/setup.cfg +0 -0
  69. {fastled-1.2.82 → fastled-1.2.83}/setup.py +0 -0
  70. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/app.py +0 -0
  71. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/assets/example.txt +0 -0
  72. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/assets/localhost-key.pem +0 -0
  73. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/assets/localhost.pem +0 -0
  74. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/cli.py +0 -0
  75. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/cli_test.py +0 -0
  76. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/cli_test_interactive.py +0 -0
  77. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/client_server.py +0 -0
  78. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/compile_server.py +0 -0
  79. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/compile_server_impl.py +0 -0
  80. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/docker_manager.py +0 -0
  81. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/filewatcher.py +0 -0
  82. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/keyboard.py +0 -0
  83. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/keyz.py +0 -0
  84. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/live_client.py +0 -0
  85. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/open_browser.py +0 -0
  86. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/parse_args.py +0 -0
  87. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/paths.py +0 -0
  88. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/print_filter.py +0 -0
  89. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/project_init.py +0 -0
  90. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/select_sketch_directory.py +0 -0
  91. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/server_start.py +0 -0
  92. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/settings.py +0 -0
  93. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/site/build.py +0 -0
  94. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/site/examples.py +0 -0
  95. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/sketch.py +0 -0
  96. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/spinner.py +0 -0
  97. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/string_diff.py +0 -0
  98. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  99. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/test/examples.py +0 -0
  100. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/types.py +0 -0
  101. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/util.py +0 -0
  102. {fastled-1.2.82 → fastled-1.2.83}/src/fastled/web_compile.py +0 -0
  103. {fastled-1.2.82 → fastled-1.2.83}/src/fastled.egg-info/dependency_links.txt +0 -0
  104. {fastled-1.2.82 → fastled-1.2.83}/src/fastled.egg-info/entry_points.txt +0 -0
  105. {fastled-1.2.82 → fastled-1.2.83}/src/fastled.egg-info/requires.txt +0 -0
  106. {fastled-1.2.82 → fastled-1.2.83}/src/fastled.egg-info/top_level.txt +0 -0
  107. {fastled-1.2.82 → fastled-1.2.83}/test +0 -0
  108. {fastled-1.2.82 → fastled-1.2.83}/tests/integration/test_build_examples.py +0 -0
  109. {fastled-1.2.82 → fastled-1.2.83}/tests/integration/test_examples.py +0 -0
  110. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/html/index.html +0 -0
  111. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_api.py +0 -0
  112. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_bad_ino.py +0 -0
  113. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_cli.py +0 -0
  114. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_compile_server.py +0 -0
  115. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_docker_linux_on_windows.py +0 -0
  116. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_embedded_data.py +0 -0
  117. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_filechanger.py +0 -0
  118. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_http_server.py +0 -0
  119. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_ino/bad/bad.ino +0 -0
  120. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_ino/bad_platformio/bad_platformio.ino +0 -0
  121. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_ino/bad_platformio/platformio.ini +0 -0
  122. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_ino/embedded/data/bigdata.dat +0 -0
  123. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_ino/embedded/wasm.ino +0 -0
  124. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_ino/wasm/wasm.ino +0 -0
  125. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_print_filter.py +0 -0
  126. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_project_init.py +0 -0
  127. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_server_and_client_seperatly.py +0 -0
  128. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_string_diff.py +0 -0
  129. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_version.py +0 -0
  130. {fastled-1.2.82 → fastled-1.2.83}/tests/unit/test_webcompile.py +0 -0
  131. {fastled-1.2.82 → fastled-1.2.83}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.2.82
3
+ Version: 1.2.83
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -632,10 +632,10 @@ def source_file(filepath: str) -> FileResponse:
632
632
  return fr
633
633
 
634
634
 
635
- @app.get("/static/{file_path:path}")
635
+ @app.get("/drawfsource/{file_path:path}")
636
636
  async def static_files(file_path: str) -> Response:
637
637
  """Serve static files."""
638
- print(f"Endpoint accessed: /static/{file_path}")
638
+ print(f"Endpoint accessed: /drawfsource/{file_path}")
639
639
 
640
640
  # Check if path matches the pattern js/fastled/src/...
641
641
  if file_path.startswith("js/fastled/src/"):
@@ -14,7 +14,7 @@ from .types import BuildMode, CompileResult, CompileServerError, FileResponse
14
14
  # IMPORTANT! There's a bug in github which will REJECT any version update
15
15
  # that has any other change in the repo. Please bump the version as the
16
16
  # ONLY change in a commit, or else the pypi update and the release will fail.
17
- __version__ = "1.2.82"
17
+ __version__ = "1.2.83"
18
18
 
19
19
 
20
20
  class Api:
@@ -5,6 +5,8 @@ from pathlib import Path
5
5
  import requests
6
6
  from livereload import Server
7
7
 
8
+ _DRAWF_SOURCE_PREFIX = "drawfsource/js/fastled/src/"
9
+
8
10
 
9
11
  def _run_flask_server(
10
12
  fastled_js: Path,
@@ -22,7 +24,7 @@ def _run_flask_server(
22
24
  keyfile: Path to the SSL key file
23
25
  """
24
26
  try:
25
- from flask import Flask, send_from_directory
27
+ from flask import Flask, Response, send_from_directory
26
28
 
27
29
  app = Flask(__name__)
28
30
 
@@ -35,13 +37,13 @@ def _run_flask_server(
35
37
  def serve_index():
36
38
  return send_from_directory(fastled_js, "index.html")
37
39
 
38
- @app.route("/static/<path:path>")
39
- def proxy_static(path):
40
- """Proxy requests to /static/* to the compile server"""
41
- from flask import Response, request
40
+ @app.route("/sourcefiles/<path:path>")
41
+ def serve_source_files(path):
42
+ """Proxy requests to /sourcefiles/* to the compile server"""
43
+ from flask import request
42
44
 
43
45
  # Forward the request to the compile server
44
- target_url = f"http://localhost:{compile_server_port}/static/{path}"
46
+ target_url = f"http://localhost:{compile_server_port}/sourcefiles/{path}"
45
47
 
46
48
  # Forward the request with the same method, headers, and body
47
49
  resp = requests.request(
@@ -61,11 +63,50 @@ def _run_flask_server(
61
63
 
62
64
  return response
63
65
 
64
- @app.route("/sourcefiles/<path:path>")
65
- def serve_source_files(path):
66
- """Proxy requests to /sourcefiles/* to the compile server"""
66
+ def handle_dwarfsource(path: str) -> Response:
67
+ """Handle requests to /drawfsource/js/fastled/src/"""
68
+ from flask import request
69
+
70
+ print("\n##################################")
71
+ print(f"# Serving source file /drawfsource/ {path}")
72
+ print("##################################\n")
73
+
74
+ if not path.startswith(_DRAWF_SOURCE_PREFIX):
75
+ # unexpected
76
+ print(f"Unexpected path: {path}")
77
+ return Response("Malformed path", status=400)
78
+
79
+ path = path.replace("drawfsource/js/fastled/src/", "")
80
+
81
+ # Forward the request to the compile server
82
+ target_url = f"http://localhost:{compile_server_port}/sourcefiles/{path}"
83
+
84
+ # Forward the request with the same method, headers, and body
85
+ resp = requests.request(
86
+ method=request.method,
87
+ url=target_url,
88
+ headers={key: value for key, value in request.headers if key != "Host"},
89
+ data=request.get_data(),
90
+ cookies=request.cookies,
91
+ allow_redirects=True,
92
+ stream=False,
93
+ )
94
+
95
+ # Create a Flask Response object from the requests response
96
+ response = Response(
97
+ resp.raw.read(), status=resp.status_code, headers=dict(resp.headers)
98
+ )
99
+
100
+ return response
101
+
102
+ def handle_sourcefile(path: str) -> Response:
103
+ """Handle requests to /sourcefiles/*"""
67
104
  from flask import Response, request
68
105
 
106
+ print("\n##################################")
107
+ print(f"# Serving source file /sourcefiles/ {path}")
108
+ print("##################################\n")
109
+
69
110
  # Forward the request to the compile server
70
111
  target_url = f"http://localhost:{compile_server_port}/sourcefiles/{path}"
71
112
 
@@ -87,8 +128,12 @@ def _run_flask_server(
87
128
 
88
129
  return response
89
130
 
90
- @app.route("/<path:path>")
91
- def serve_files(path):
131
+ def handle_local_file_fetch(path: str) -> Response:
132
+
133
+ print("\n##################################")
134
+ print(f"# Servering generic file {path}")
135
+ print("##################################\n")
136
+
92
137
  response = send_from_directory(fastled_js, path)
93
138
  # Some servers don't set the Content-Type header for a bunch of files.
94
139
  if path.endswith(".js"):
@@ -120,6 +165,16 @@ def _run_flask_server(
120
165
  response.headers["Expires"] = "0"
121
166
  return response
122
167
 
168
+ @app.route("/<path:path>")
169
+ def serve_files(path: str):
170
+
171
+ if path.startswith("drawfsource/"):
172
+ return handle_dwarfsource(path)
173
+ elif path.startswith("sourcefiles/"):
174
+ return handle_sourcefile(path)
175
+ else:
176
+ return handle_local_file_fetch(path)
177
+
123
178
  server = Server(app.wsgi_app)
124
179
  # Watch index.html for changes
125
180
  server.watch(str(fastled_js / "index.html"))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastled
3
- Version: 1.2.82
3
+ Version: 1.2.83
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -111,7 +111,7 @@ tests/unit/test_cli.py
111
111
  tests/unit/test_compile_server.py
112
112
  tests/unit/test_docker_linux_on_windows.py
113
113
  tests/unit/test_embedded_data.py
114
- tests/unit/test_fastled_source_get.py
114
+ tests/unit/test_fetch_source_files.py
115
115
  tests/unit/test_filechanger.py
116
116
  tests/unit/test_http_server.py
117
117
  tests/unit/test_print_filter.py
@@ -67,7 +67,16 @@ class FetchSourceFileTester(unittest.TestCase):
67
67
 
68
68
  resp = httpx.get(
69
69
  f"http://localhost:{http_port}/sourcefiles/FastLED.h",
70
- timeout=10,
70
+ timeout=100,
71
+ )
72
+ if resp.status_code != 200:
73
+ raise Exception(f"Failed to fetch source file: {resp.status_code}")
74
+
75
+ # now get something similar at static/js/fastled/src/platforms/wasm/js.cpp
76
+ url = f"http://localhost:{http_port}/drawfsource/js/fastled/src/FastLED.h"
77
+ resp = httpx.get(
78
+ url,
79
+ timeout=100,
71
80
  )
72
81
  if resp.status_code != 200:
73
82
  raise Exception(f"Failed to fetch source file: {resp.status_code}")
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