fastled 1.2.36__tar.gz → 1.2.39__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 (89) hide show
  1. {fastled-1.2.36 → fastled-1.2.39}/PKG-INFO +2 -2
  2. {fastled-1.2.36 → fastled-1.2.39}/README.md +1 -1
  3. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/__init__.py +24 -13
  4. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/app.py +1 -1
  5. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/compile_server_impl.py +2 -4
  6. fastled-1.2.39/src/fastled/interactive_srcs.py +5 -0
  7. {fastled-1.2.36 → fastled-1.2.39}/src/fastled.egg-info/PKG-INFO +2 -2
  8. {fastled-1.2.36 → fastled-1.2.39}/src/fastled.egg-info/SOURCES.txt +1 -1
  9. {fastled-1.2.36 → fastled-1.2.39}/tests/test_build_from_docker.py +3 -1
  10. {fastled-1.2.36 → fastled-1.2.39}/tests/test_build_from_github.py +8 -5
  11. {fastled-1.2.36 → fastled-1.2.39}/tests/test_http_server.py +12 -4
  12. fastled-1.2.36/tests/test_build.py +0 -57
  13. {fastled-1.2.36 → fastled-1.2.39}/.aiderignore +0 -0
  14. {fastled-1.2.36 → fastled-1.2.39}/.github/workflows/build_multi_docker_image.yml +0 -0
  15. {fastled-1.2.36 → fastled-1.2.39}/.github/workflows/build_webpage.yml +0 -0
  16. {fastled-1.2.36 → fastled-1.2.39}/.github/workflows/lint.yml +0 -0
  17. {fastled-1.2.36 → fastled-1.2.39}/.github/workflows/publish_release.yml +0 -0
  18. {fastled-1.2.36 → fastled-1.2.39}/.github/workflows/test_build_exe.yml +0 -0
  19. {fastled-1.2.36 → fastled-1.2.39}/.github/workflows/test_macos.yml +0 -0
  20. {fastled-1.2.36 → fastled-1.2.39}/.github/workflows/test_ubuntu.yml +0 -0
  21. {fastled-1.2.36 → fastled-1.2.39}/.github/workflows/test_win.yml +0 -0
  22. {fastled-1.2.36 → fastled-1.2.39}/.gitignore +0 -0
  23. {fastled-1.2.36 → fastled-1.2.39}/.pylintrc +0 -0
  24. {fastled-1.2.36 → fastled-1.2.39}/.vscode/launch.json +0 -0
  25. {fastled-1.2.36 → fastled-1.2.39}/.vscode/settings.json +0 -0
  26. {fastled-1.2.36 → fastled-1.2.39}/.vscode/tasks.json +0 -0
  27. {fastled-1.2.36 → fastled-1.2.39}/LICENSE +0 -0
  28. {fastled-1.2.36 → fastled-1.2.39}/MANIFEST.in +0 -0
  29. {fastled-1.2.36 → fastled-1.2.39}/RELEASE.md +0 -0
  30. {fastled-1.2.36 → fastled-1.2.39}/TODO.md +0 -0
  31. {fastled-1.2.36 → fastled-1.2.39}/build_exe.py +0 -0
  32. {fastled-1.2.36 → fastled-1.2.39}/build_site.py +0 -0
  33. {fastled-1.2.36 → fastled-1.2.39}/clean +0 -0
  34. {fastled-1.2.36 → fastled-1.2.39}/install +0 -0
  35. {fastled-1.2.36 → fastled-1.2.39}/install_linux.sh +0 -0
  36. {fastled-1.2.36 → fastled-1.2.39}/lint +0 -0
  37. {fastled-1.2.36 → fastled-1.2.39}/pyproject.toml +0 -0
  38. {fastled-1.2.36 → fastled-1.2.39}/requirements.testing.txt +0 -0
  39. {fastled-1.2.36 → fastled-1.2.39}/setup.cfg +0 -0
  40. {fastled-1.2.36 → fastled-1.2.39}/setup.py +0 -0
  41. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/assets/example.txt +0 -0
  42. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/cli.py +0 -0
  43. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/client_server.py +0 -0
  44. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/compile_server.py +0 -0
  45. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/docker_manager.py +0 -0
  46. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/filewatcher.py +0 -0
  47. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/keyboard.py +0 -0
  48. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/live_client.py +0 -0
  49. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/open_browser.py +0 -0
  50. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/open_browser2.py +0 -0
  51. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/parse_args.py +0 -0
  52. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/paths.py +0 -0
  53. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/project_init.py +0 -0
  54. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/select_sketch_directory.py +0 -0
  55. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/settings.py +0 -0
  56. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/site/build.py +0 -0
  57. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/sketch.py +0 -0
  58. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/spinner.py +0 -0
  59. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/string_diff.py +0 -0
  60. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  61. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/test/examples.py +0 -0
  62. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/types.py +0 -0
  63. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/util.py +0 -0
  64. {fastled-1.2.36 → fastled-1.2.39}/src/fastled/web_compile.py +0 -0
  65. {fastled-1.2.36 → fastled-1.2.39}/src/fastled.egg-info/dependency_links.txt +0 -0
  66. {fastled-1.2.36 → fastled-1.2.39}/src/fastled.egg-info/entry_points.txt +0 -0
  67. {fastled-1.2.36 → fastled-1.2.39}/src/fastled.egg-info/requires.txt +0 -0
  68. {fastled-1.2.36 → fastled-1.2.39}/src/fastled.egg-info/top_level.txt +0 -0
  69. {fastled-1.2.36 → fastled-1.2.39}/test +0 -0
  70. {fastled-1.2.36 → fastled-1.2.39}/tests/html/index.html +0 -0
  71. {fastled-1.2.36 → fastled-1.2.39}/tests/test_api.py +0 -0
  72. {fastled-1.2.36 → fastled-1.2.39}/tests/test_bad_ino.py +0 -0
  73. {fastled-1.2.36 → fastled-1.2.39}/tests/test_build_examples.py +0 -0
  74. {fastled-1.2.36 → fastled-1.2.39}/tests/test_cli.py +0 -0
  75. {fastled-1.2.36 → fastled-1.2.39}/tests/test_compile_server.py +0 -0
  76. {fastled-1.2.36 → fastled-1.2.39}/tests/test_docker_linux_on_windows.py +0 -0
  77. {fastled-1.2.36 → fastled-1.2.39}/tests/test_embedded_data.py +0 -0
  78. {fastled-1.2.36 → fastled-1.2.39}/tests/test_examples.py +0 -0
  79. {fastled-1.2.36 → fastled-1.2.39}/tests/test_filechanger.py +0 -0
  80. {fastled-1.2.36 → fastled-1.2.39}/tests/test_ino/bad/bad.ino +0 -0
  81. {fastled-1.2.36 → fastled-1.2.39}/tests/test_ino/bad_platformio/bad_platformio.ino +0 -0
  82. {fastled-1.2.36 → fastled-1.2.39}/tests/test_ino/bad_platformio/platformio.ini +0 -0
  83. {fastled-1.2.36 → fastled-1.2.39}/tests/test_ino/embedded/data/bigdata.dat +0 -0
  84. {fastled-1.2.36 → fastled-1.2.39}/tests/test_ino/embedded/wasm.ino +0 -0
  85. {fastled-1.2.36 → fastled-1.2.39}/tests/test_ino/wasm/wasm.ino +0 -0
  86. {fastled-1.2.36 → fastled-1.2.39}/tests/test_project_init.py +0 -0
  87. {fastled-1.2.36 → fastled-1.2.39}/tests/test_server_and_client_seperatly.py +0 -0
  88. {fastled-1.2.36 → fastled-1.2.39}/tests/test_webcompile.py +0 -0
  89. {fastled-1.2.36 → fastled-1.2.39}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fastled
3
- Version: 1.2.36
3
+ Version: 1.2.39
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -211,7 +211,7 @@ with Api.server() as server:
211
211
  **Build Docker Image from a local copy of the FastLED repo**
212
212
  ```python
213
213
  from fastapi import Docker, Api
214
- container_name: str = Docker.build_from_fastled_repo()
214
+ container_name: str = Docker.spawn_server_from_fastled_repo()
215
215
  with Api.server(container_name=container_name) as server:
216
216
  ...
217
217
  ```
@@ -185,7 +185,7 @@ with Api.server() as server:
185
185
  **Build Docker Image from a local copy of the FastLED repo**
186
186
  ```python
187
187
  from fastapi import Docker, Api
188
- container_name: str = Docker.build_from_fastled_repo()
188
+ container_name: str = Docker.spawn_server_from_fastled_repo()
189
189
  with Api.server(container_name=container_name) as server:
190
190
  ...
191
191
  ```
@@ -16,7 +16,7 @@ from .types import BuildMode, CompileResult, CompileServerError
16
16
  # IMPORTANT! There's a bug in github which will REJECT any version update
17
17
  # that has any other change in the repo. Please bump the version as the
18
18
  # ONLY change in a commit, or else the pypi update and the release will fail.
19
- __version__ = "1.2.36"
19
+ __version__ = "1.2.39"
20
20
 
21
21
 
22
22
  class Api:
@@ -157,10 +157,10 @@ class Docker:
157
157
  docker_mgr.purge(image_name=IMAGE_NAME)
158
158
 
159
159
  @staticmethod
160
- def build_from_github(
160
+ def spawn_server_from_github(
161
161
  url: str = "https://github.com/fastled/fastled",
162
162
  output_dir: Path | str = Path(".cache/fastled"),
163
- ) -> str:
163
+ ) -> CompileServer:
164
164
  """Build the FastLED WASM compiler Docker image from a GitHub repository.
165
165
 
166
166
  Args:
@@ -252,21 +252,32 @@ class Docker:
252
252
  platform_tag=platform_tag,
253
253
  )
254
254
 
255
- # Run the container and return it
256
- container = docker_mgr.run_container_detached(
257
- image_name=IMAGE_NAME,
258
- tag="main",
255
+ # # Run the container and return it
256
+ # container = docker_mgr.run_container_detached(
257
+ # image_name=IMAGE_NAME,
258
+ # tag="main",
259
+ # container_name=CONTAINER_NAME,
260
+ # command=None, # Use default command from Dockerfile
261
+ # volumes=None, # No volumes needed for build
262
+ # ports=None, # No ports needed for build
263
+ # remove_previous=True, # Remove any existing container
264
+ # )
265
+ # name = container.name
266
+ # container.stop()
267
+
268
+ out: CompileServer = CompileServer(
259
269
  container_name=CONTAINER_NAME,
260
- command=None, # Use default command from Dockerfile
261
- volumes=None, # No volumes needed for build
262
- ports=None, # No ports needed for build
263
- remove_previous=True, # Remove any existing container
270
+ interactive=False,
271
+ auto_updates=False,
272
+ mapped_dir=None,
273
+ auto_start=True,
274
+ remove_previous=True,
264
275
  )
265
276
 
266
- return container.name # Todo, create an external docker container api.
277
+ return out
267
278
 
268
279
  @staticmethod
269
- def build_from_fastled_repo(
280
+ def spawn_server_from_fastled_repo(
270
281
  project_root: Path | str = Path("."),
271
282
  interactive: bool = False,
272
283
  sketch_folder: Path | None = None,
@@ -66,7 +66,7 @@ def main() -> int:
66
66
  print(f"Building Docker image at {project_root}")
67
67
  from fastled import Api, Docker
68
68
 
69
- server = Docker.build_from_fastled_repo(
69
+ server = Docker.spawn_server_from_fastled_repo(
70
70
  project_root=project_root, interactive=interactive
71
71
  )
72
72
  assert isinstance(server, CompileServer)
@@ -13,6 +13,7 @@ from fastled.docker_manager import (
13
13
  DockerManager,
14
14
  RunningContainer,
15
15
  )
16
+ from fastled.interactive_srcs import INTERACTIVE_SOURCES
16
17
  from fastled.settings import DEFAULT_CONTAINER_NAME, IMAGE_NAME, SERVER_PORT
17
18
  from fastled.sketch import looks_like_fastled_repo
18
19
  from fastled.types import BuildMode, CompileResult, CompileServerError
@@ -221,10 +222,7 @@ class CompileServerImpl:
221
222
  if self.fastled_src_dir is not None:
222
223
  # add volume for src/platforms/wasm/compiler/CMakelists.txt
223
224
  # to allow for interactive compilation
224
- interactive_sources = [
225
- "src/platforms/wasm/compiler/CMakeLists.txt",
226
- "src/platforms/wasm/compiler/build_archive.sh",
227
- ]
225
+ interactive_sources = list(INTERACTIVE_SOURCES)
228
226
  for src in interactive_sources:
229
227
  src_path = Path(src).absolute()
230
228
  if src_path.exists():
@@ -0,0 +1,5 @@
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",
5
+ ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: fastled
3
- Version: 1.2.36
3
+ Version: 1.2.39
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -211,7 +211,7 @@ with Api.server() as server:
211
211
  **Build Docker Image from a local copy of the FastLED repo**
212
212
  ```python
213
213
  from fastapi import Docker, Api
214
- container_name: str = Docker.build_from_fastled_repo()
214
+ container_name: str = Docker.spawn_server_from_fastled_repo()
215
215
  with Api.server(container_name=container_name) as server:
216
216
  ...
217
217
  ```
@@ -36,6 +36,7 @@ src/fastled/compile_server.py
36
36
  src/fastled/compile_server_impl.py
37
37
  src/fastled/docker_manager.py
38
38
  src/fastled/filewatcher.py
39
+ src/fastled/interactive_srcs.py
39
40
  src/fastled/keyboard.py
40
41
  src/fastled/live_client.py
41
42
  src/fastled/open_browser.py
@@ -63,7 +64,6 @@ src/fastled/test/can_run_local_docker_tests.py
63
64
  src/fastled/test/examples.py
64
65
  tests/test_api.py
65
66
  tests/test_bad_ino.py
66
- tests/test_build.py
67
67
  tests/test_build_examples.py
68
68
  tests/test_build_from_docker.py
69
69
  tests/test_build_from_github.py
@@ -34,7 +34,9 @@ class BuildDockerFromRepoTester(unittest.TestCase):
34
34
  @unittest.skipUnless(_enabled(), "Skipping test on non-Linux system on github")
35
35
  def test_build_docker(self) -> None:
36
36
  """Builds the docker file from the fastled repo."""
37
- server: CompileServer = Docker.build_from_fastled_repo(FASTLED_SISTER_REPO)
37
+ server: CompileServer = Docker.spawn_server_from_fastled_repo(
38
+ FASTLED_SISTER_REPO
39
+ )
38
40
  self.assertIsNotNone(server, "Failed to build docker image")
39
41
 
40
42
  try:
@@ -5,7 +5,7 @@ Unit test file.
5
5
  import unittest
6
6
  from pathlib import Path
7
7
 
8
- from fastled import Api, CompileServer, Docker, Test # type: ignore
8
+ from fastled import CompileServer, Docker, Test # type: ignore
9
9
 
10
10
  HERE = Path(__file__).parent
11
11
  PROJECT_ROOT = HERE.parent
@@ -35,11 +35,14 @@ class BuildDockerFromGithubTester(unittest.TestCase):
35
35
  """Builds the docker file from the fastled repo."""
36
36
  url = DEFAULT_GITHUB_URL
37
37
  print("Building from github")
38
- docker_image_name = Docker.build_from_github(url=url, output_dir=OUTPUT_DIR)
39
- self.assertTrue(docker_image_name, "Failed to build docker image")
40
- server: CompileServer
41
- with Api.server(auto_updates=True, container_name=docker_image_name) as server:
38
+ server: CompileServer = Docker.spawn_server_from_github(
39
+ url=url, output_dir=OUTPUT_DIR
40
+ )
41
+ self.assertTrue(server, "Failed to build docker image")
42
+ try:
42
43
  self.assertTrue(server.ping())
44
+ finally:
45
+ server.stop()
43
46
 
44
47
 
45
48
  if __name__ == "__main__":
@@ -2,6 +2,7 @@
2
2
  Unit test file.
3
3
  """
4
4
 
5
+ import random
5
6
  import unittest
6
7
  from pathlib import Path
7
8
 
@@ -16,20 +17,27 @@ TIMEOUT = 120
16
17
  assert INDEX_HTML.exists()
17
18
 
18
19
 
20
+ # realistic range, 8021 - 8030
21
+ PORT = random.randint(8021, 8030)
22
+ PORT2 = PORT + 1
23
+
24
+
19
25
  class HttpServerTester(unittest.TestCase):
20
26
  """Main tester class."""
21
27
 
22
28
  def test_http_server(self) -> None:
23
29
  """Test the http server."""
24
- proc = Test.spawn_http_server(INDEX_HTML.parent, port=8021, open_browser=False)
25
- response = httpx.get("http://localhost:8021", timeout=1)
30
+ port = PORT
31
+ proc = Test.spawn_http_server(INDEX_HTML.parent, port=port, open_browser=False)
32
+ response = httpx.get(f"http://localhost:{port}", timeout=1)
26
33
  self.assertEqual(response.status_code, 200)
27
34
  proc.terminate()
28
35
 
29
36
  def test_http_server_404(self) -> None:
30
37
  """Test the http server returns 404 for non-existent files."""
31
- proc = Test.spawn_http_server(INDEX_HTML.parent, port=8022, open_browser=False)
32
- response = httpx.get("http://localhost:8022/nonexistent.html", timeout=1)
38
+ port = PORT2
39
+ proc = Test.spawn_http_server(INDEX_HTML.parent, port=port, open_browser=False)
40
+ response = httpx.get(f"http://localhost:{port}/nonexistent.html", timeout=1)
33
41
  self.assertEqual(response.status_code, 404)
34
42
  proc.terminate()
35
43
 
@@ -1,57 +0,0 @@
1
- """
2
- Unit test file.
3
- """
4
-
5
- import unittest
6
- from pathlib import Path
7
-
8
- from fastled import Api, CompileServer, Docker, Test # type: ignore
9
-
10
- HERE = Path(__file__).parent
11
- PROJECT_ROOT = HERE.parent
12
- FASTLED_SISTER_REPO = PROJECT_ROOT / ".." / "FastLED"
13
-
14
- DEFAULT_GITHUB_URL = "https://github.com/fastled/fastled"
15
- OUTPUT_DIR = Path(".cache/fastled")
16
-
17
-
18
- def _enabled() -> bool:
19
- """Check if this system can run the tests."""
20
- sister_repo_does_not_exist = not FASTLED_SISTER_REPO.exists()
21
-
22
- if sister_repo_does_not_exist:
23
- print(
24
- f"This test is only enable when FastLED is a repo in the same directly as the project root folder: {FASTLED_SISTER_REPO} does not exist"
25
- )
26
- return False
27
-
28
- return Test.can_run_local_docker_tests()
29
-
30
-
31
- class BuildDockerFromRepoTester(unittest.TestCase):
32
- """Main tester class."""
33
-
34
- @unittest.skipUnless(_enabled(), "Skipping test on non-Linux system on github")
35
- def test_build_docker(self) -> None:
36
- """Builds the docker file from the fastled repo."""
37
-
38
- container = Docker.build_from_fastled_repo(FASTLED_SISTER_REPO)
39
- try:
40
- self.assertTrue(container.ping())
41
- finally:
42
- container.stop()
43
-
44
- @unittest.skipUnless(_enabled(), "Skipping test on non-Linux system on github")
45
- def test_build_docker_from_github(self) -> None:
46
- """Builds the docker file from the fastled repo."""
47
- url = DEFAULT_GITHUB_URL
48
- print("Building from github")
49
- docker_image_name = Docker.build_from_github(url=url, output_dir=OUTPUT_DIR)
50
- self.assertTrue(docker_image_name, "Failed to build docker image")
51
- server: CompileServer
52
- with Api.server(auto_updates=True, container_name=docker_image_name) as server:
53
- self.assertTrue(server.ping())
54
-
55
-
56
- if __name__ == "__main__":
57
- unittest.main()
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