fastled 1.2.9__tar.gz → 1.2.10__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 (81) hide show
  1. {fastled-1.2.9 → fastled-1.2.10}/PKG-INFO +2 -1
  2. {fastled-1.2.9 → fastled-1.2.10}/README.md +1 -0
  3. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/__init__.py +16 -1
  4. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/open_browser.py +18 -5
  5. {fastled-1.2.9 → fastled-1.2.10}/src/fastled.egg-info/PKG-INFO +2 -1
  6. {fastled-1.2.9 → fastled-1.2.10}/src/fastled.egg-info/SOURCES.txt +1 -0
  7. fastled-1.2.10/tests/html/index.html +9 -0
  8. {fastled-1.2.9 → fastled-1.2.10}/tests/test_api.py +20 -1
  9. {fastled-1.2.9 → fastled-1.2.10}/.aiderignore +0 -0
  10. {fastled-1.2.9 → fastled-1.2.10}/.github/workflows/build_multi_docker_image.yml +0 -0
  11. {fastled-1.2.9 → fastled-1.2.10}/.github/workflows/build_webpage.yml +0 -0
  12. {fastled-1.2.9 → fastled-1.2.10}/.github/workflows/lint.yml +0 -0
  13. {fastled-1.2.9 → fastled-1.2.10}/.github/workflows/publish_release.yml +0 -0
  14. {fastled-1.2.9 → fastled-1.2.10}/.github/workflows/test_build_exe.yml +0 -0
  15. {fastled-1.2.9 → fastled-1.2.10}/.github/workflows/test_macos.yml +0 -0
  16. {fastled-1.2.9 → fastled-1.2.10}/.github/workflows/test_ubuntu.yml +0 -0
  17. {fastled-1.2.9 → fastled-1.2.10}/.github/workflows/test_win.yml +0 -0
  18. {fastled-1.2.9 → fastled-1.2.10}/.gitignore +0 -0
  19. {fastled-1.2.9 → fastled-1.2.10}/.pylintrc +0 -0
  20. {fastled-1.2.9 → fastled-1.2.10}/.vscode/launch.json +0 -0
  21. {fastled-1.2.9 → fastled-1.2.10}/.vscode/settings.json +0 -0
  22. {fastled-1.2.9 → fastled-1.2.10}/.vscode/tasks.json +0 -0
  23. {fastled-1.2.9 → fastled-1.2.10}/LICENSE +0 -0
  24. {fastled-1.2.9 → fastled-1.2.10}/MANIFEST.in +0 -0
  25. {fastled-1.2.9 → fastled-1.2.10}/RELEASE.md +0 -0
  26. {fastled-1.2.9 → fastled-1.2.10}/TODO.md +0 -0
  27. {fastled-1.2.9 → fastled-1.2.10}/build_exe.py +0 -0
  28. {fastled-1.2.9 → fastled-1.2.10}/build_site.py +0 -0
  29. {fastled-1.2.9 → fastled-1.2.10}/clean +0 -0
  30. {fastled-1.2.9 → fastled-1.2.10}/install +0 -0
  31. {fastled-1.2.9 → fastled-1.2.10}/lint +0 -0
  32. {fastled-1.2.9 → fastled-1.2.10}/pyproject.toml +0 -0
  33. {fastled-1.2.9 → fastled-1.2.10}/requirements.testing.txt +0 -0
  34. {fastled-1.2.9 → fastled-1.2.10}/setup.cfg +0 -0
  35. {fastled-1.2.9 → fastled-1.2.10}/setup.py +0 -0
  36. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/app.py +0 -0
  37. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/assets/example.txt +0 -0
  38. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/cli.py +0 -0
  39. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/client_server.py +0 -0
  40. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/compile_server.py +0 -0
  41. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/compile_server_impl.py +0 -0
  42. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/docker_manager.py +0 -0
  43. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/filewatcher.py +0 -0
  44. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/keyboard.py +0 -0
  45. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/live_client.py +0 -0
  46. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/parse_args.py +0 -0
  47. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/paths.py +0 -0
  48. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/project_init.py +0 -0
  49. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/select_sketch_directory.py +0 -0
  50. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/settings.py +0 -0
  51. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/site/build.py +0 -0
  52. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/sketch.py +0 -0
  53. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/spinner.py +0 -0
  54. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/string_diff.py +0 -0
  55. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/test/can_run_local_docker_tests.py +0 -0
  56. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/test/examples.py +0 -0
  57. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/types.py +0 -0
  58. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/util.py +0 -0
  59. {fastled-1.2.9 → fastled-1.2.10}/src/fastled/web_compile.py +0 -0
  60. {fastled-1.2.9 → fastled-1.2.10}/src/fastled.egg-info/dependency_links.txt +0 -0
  61. {fastled-1.2.9 → fastled-1.2.10}/src/fastled.egg-info/entry_points.txt +0 -0
  62. {fastled-1.2.9 → fastled-1.2.10}/src/fastled.egg-info/requires.txt +0 -0
  63. {fastled-1.2.9 → fastled-1.2.10}/src/fastled.egg-info/top_level.txt +0 -0
  64. {fastled-1.2.9 → fastled-1.2.10}/test +0 -0
  65. {fastled-1.2.9 → fastled-1.2.10}/tests/test_bad_ino.py +0 -0
  66. {fastled-1.2.9 → fastled-1.2.10}/tests/test_build.py +0 -0
  67. {fastled-1.2.9 → fastled-1.2.10}/tests/test_build_examples.py +0 -0
  68. {fastled-1.2.9 → fastled-1.2.10}/tests/test_cli.py +0 -0
  69. {fastled-1.2.9 → fastled-1.2.10}/tests/test_compile_server.py +0 -0
  70. {fastled-1.2.9 → fastled-1.2.10}/tests/test_docker_linux_on_windows.py +0 -0
  71. {fastled-1.2.9 → fastled-1.2.10}/tests/test_embedded_data.py +0 -0
  72. {fastled-1.2.9 → fastled-1.2.10}/tests/test_examples.py +0 -0
  73. {fastled-1.2.9 → fastled-1.2.10}/tests/test_filechanger.py +0 -0
  74. {fastled-1.2.9 → fastled-1.2.10}/tests/test_ino/bad/bad.ino +0 -0
  75. {fastled-1.2.9 → fastled-1.2.10}/tests/test_ino/embedded/data/bigdata.dat +0 -0
  76. {fastled-1.2.9 → fastled-1.2.10}/tests/test_ino/embedded/wasm.ino +0 -0
  77. {fastled-1.2.9 → fastled-1.2.10}/tests/test_ino/wasm/wasm.ino +0 -0
  78. {fastled-1.2.9 → fastled-1.2.10}/tests/test_project_init.py +0 -0
  79. {fastled-1.2.9 → fastled-1.2.10}/tests/test_server_and_client_seperatly.py +0 -0
  80. {fastled-1.2.9 → fastled-1.2.10}/tests/test_webcompile.py +0 -0
  81. {fastled-1.2.9 → fastled-1.2.10}/upload_package.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.2.9
3
+ Version: 1.2.10
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -274,6 +274,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
274
274
 
275
275
  # Revisions
276
276
 
277
+ * 1.2.10 - `fastled.Test` now allows you to spawn the http webserver on a folder with an index.html in it.
277
278
  * 1.2.7 - A bunch of fixes for MacOS and probably linux.
278
279
  * 1.2.6 - Now builds image from the project root of FastLED.
279
280
  * 1.1.25 - Fix up paths for `--init`
@@ -251,6 +251,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
251
251
 
252
252
  # Revisions
253
253
 
254
+ * 1.2.10 - `fastled.Test` now allows you to spawn the http webserver on a folder with an index.html in it.
254
255
  * 1.2.7 - A bunch of fixes for MacOS and probably linux.
255
256
  * 1.2.6 - Now builds image from the project root of FastLED.
256
257
  * 1.1.25 - Fix up paths for `--init`
@@ -14,7 +14,7 @@ from .types import BuildMode, CompileResult, CompileServerError
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.9"
17
+ __version__ = "1.2.10"
18
18
 
19
19
 
20
20
  class Api:
@@ -313,6 +313,21 @@ class Test:
313
313
  """Builds the FastLED compiler site."""
314
314
  build(outputdir=outputdir, fast=fast, check=check)
315
315
 
316
+ @staticmethod
317
+ def spawn_http_server(
318
+ directory: Path | str = Path("."),
319
+ port: int = 8000,
320
+ open_browser: bool = True,
321
+ ) -> subprocess.Popen:
322
+ from fastled.open_browser import open_http_server
323
+
324
+ if isinstance(directory, str):
325
+ directory = Path(directory)
326
+ proc: subprocess.Popen = open_http_server(
327
+ directory, port=port, open_browser=open_browser
328
+ )
329
+ return proc
330
+
316
331
 
317
332
  __all__ = [
318
333
  "Api",
@@ -8,15 +8,28 @@ from pathlib import Path
8
8
  DEFAULT_PORT = 8081
9
9
 
10
10
 
11
- def _open_browser_python(fastled_js: Path) -> None:
11
+ def open_http_server(
12
+ fastled_js: Path, port: int | None = None, open_browser=True
13
+ ) -> subprocess.Popen:
12
14
  """Start livereload server in the fastled_js directory using API"""
15
+ cmd_list: list[str]
13
16
  print(f"\nStarting livereload server in {fastled_js}")
14
17
  if shutil.which("live-server") is None:
15
18
  print("live-server not found. Installing it with the embedded npm...")
16
- subprocess.run(
17
- [sys.executable, "-m", "nodejs.npm", "install", "-g", "live-server"]
18
- )
19
- proc = subprocess.Popen(["cd", fastled_js, "&&", "live-server"])
19
+ cmd_list = [sys.executable, "-m", "npm", "install", "-g", "live-server"]
20
+ subprocess.run(cmd_list)
21
+ cmd_list = ["live-server"]
22
+ if port is not None:
23
+ cmd_list.extend([f"--port={port}"])
24
+ if not open_browser:
25
+ cmd_list.append("--no-browser")
26
+ # subprocess.run(["cd", str(fastled_js), "&&"] + cmd_list)
27
+ return subprocess.Popen(cmd_list, cwd=fastled_js, shell=True)
28
+
29
+
30
+ def _open_browser_python(fastled_js: Path) -> None:
31
+ """Start livereload server in the fastled_js directory using API"""
32
+ proc = open_http_server(fastled_js)
20
33
  proc.wait()
21
34
 
22
35
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastled
3
- Version: 1.2.9
3
+ Version: 1.2.10
4
4
  Summary: FastLED Wasm Compiler
5
5
  Home-page: https://github.com/zackees/fastled-wasm
6
6
  Maintainer: Zachary Vorhies
@@ -274,6 +274,7 @@ A: A big chunk of space is being used by unnecessary javascript `emscripten` bun
274
274
 
275
275
  # Revisions
276
276
 
277
+ * 1.2.10 - `fastled.Test` now allows you to spawn the http webserver on a folder with an index.html in it.
277
278
  * 1.2.7 - A bunch of fixes for MacOS and probably linux.
278
279
  * 1.2.6 - Now builds image from the project root of FastLED.
279
280
  * 1.1.25 - Fix up paths for `--init`
@@ -72,6 +72,7 @@ tests/test_filechanger.py
72
72
  tests/test_project_init.py
73
73
  tests/test_server_and_client_seperatly.py
74
74
  tests/test_webcompile.py
75
+ tests/html/index.html
75
76
  tests/test_ino/bad/bad.ino
76
77
  tests/test_ino/embedded/wasm.ino
77
78
  tests/test_ino/embedded/data/bigdata.dat
@@ -0,0 +1,9 @@
1
+ <html>
2
+ <head>
3
+ <title>Test</title>
4
+ </head>
5
+ <body>
6
+ <h1>Test</h1>
7
+ <p>Test</p>
8
+ </body>
9
+ </html>
@@ -4,10 +4,19 @@ Unit test file.
4
4
 
5
5
  import os
6
6
  import platform
7
+ import time
7
8
  import unittest
9
+ from pathlib import Path
8
10
  from tempfile import TemporaryDirectory
9
11
 
10
- from fastled import Api, CompileServer, LiveClient
12
+ import httpx
13
+
14
+ from fastled import Api, CompileServer, LiveClient, Test
15
+
16
+ HERE = Path(__file__).parent
17
+ INDEX_HTML = HERE / "html" / "index.html"
18
+
19
+ assert INDEX_HTML.exists()
11
20
 
12
21
  # def override(url) -> None:
13
22
  # """Override the server url."""
@@ -57,6 +66,16 @@ class ApiTester(unittest.TestCase):
57
66
  # now test that fastled_js is in the sketch directory
58
67
  self.assertTrue(expected_output_dir.exists())
59
68
 
69
+ def test_http_server(self) -> None:
70
+ """Test the http server."""
71
+ proc = Test.spawn_http_server(INDEX_HTML.parent, port=8081, open_browser=False)
72
+ time.sleep(1)
73
+ # test get request
74
+ response = httpx.get("http://localhost:8081")
75
+ self.assertEqual(response.status_code, 200)
76
+ proc.kill()
77
+ proc.wait()
78
+
60
79
 
61
80
  if __name__ == "__main__":
62
81
  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
File without changes