diff --git a/pkgs/development/python-modules/python-resize-image/default.nix b/pkgs/development/python-modules/python-resize-image/default.nix new file mode 100644 index 000000000000..f0e272b7e8d9 --- /dev/null +++ b/pkgs/development/python-modules/python-resize-image/default.nix @@ -0,0 +1,43 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, + pillow, + requests, +}: + +buildPythonPackage (finalAttrs: { + pname = "python-resize-image"; + version = "1.1.20"; + pyproject = true; + + src = fetchPypi { + inherit (finalAttrs) pname version; + hash = "sha256-sFXauRnWI+zo7JUmLUvb8AbLGhDoGOmzYiHIsYhfmSI="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + pillow + requests + ]; + + pythonImportsCheck = [ + "resizeimage" + ]; + + doCheck = false; # sdist missing test artifact + + __structuredAttrs = true; + + meta = { + description = "Python package to easily resize images"; + homepage = "https://pypi.org/project/python-resize-image"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hexa ]; + }; +}) diff --git a/pkgs/servers/home-assistant/custom-components/opendisplay/package.nix b/pkgs/servers/home-assistant/custom-components/opendisplay/package.nix new file mode 100644 index 000000000000..ce0781ea8beb --- /dev/null +++ b/pkgs/servers/home-assistant/custom-components/opendisplay/package.nix @@ -0,0 +1,79 @@ +{ + lib, + buildHomeAssistantComponent, + fetchFromGitHub, + + # dependencies + bleak, + bleak-retry-connector, + python-resize-image, + numpy, + qrcode, + requests-toolbelt, + websocket-client, + websockets, + + # tests + pytest-asyncio, + pytest-homeassistant-custom-component, + pytestCheckHook, +}: + +buildHomeAssistantComponent (finalAttrs: { + owner = "OpenDisplay"; + domain = "opendisplay"; + version = "2.0.2"; + + src = fetchFromGitHub { + inherit (finalAttrs) owner; + repo = "Home_Assistant_Integration"; + tag = finalAttrs.version; + hash = "sha256-EmcDY31cTWK+JRErM6EWO0jrQvIaxKXgeI6i5qiwYGU="; + }; + + dependencies = [ + bleak + bleak-retry-connector + numpy + python-resize-image + qrcode + requests-toolbelt + websocket-client + websockets + ] + ++ qrcode.optional-dependencies.pil; + + ignoreVersionRequirement = [ + "qrcode" + "websocket-client" + ]; + + nativeCheckInputs = [ + pytest-asyncio + pytest-homeassistant-custom-component + pytestCheckHook + ]; + + disabledTestPaths = [ + # Probably mismatch in fontconfig priorities + "tests/drawcustom/text_multiline_test.py::test_text_multiline_delimiter" # AssertionError: Multiline text with delimiter rendering failed + "tests/drawcustom/text_multiline_test.py::test_text_multiline_empty_line" # AssertionError: Multiline text with empty line rendering failed + "tests/drawcustom/text_multiline_test.py::test_text_multiline_delimiter_and_newline" # AssertionError: Multiline text with delimiter and newline rendering failed + "tests/drawcustom/text_test.py::test_small_font_size" # AssertionError: Small font size rendering failed + "tests/drawcustom/text_test.py::test_large_font_size" # AssertionError: Large font size rendering failed + "tests/drawcustom/text_test.py::test_text_wrapping" # AssertionError: Text wrapping failed + "tests/drawcustom/text_test.py::test_text_wrapping_with_anchor" # AssertionError: Text wrapping failed + "tests/drawcustom/text_test.py::test_text_with_special_characters" # AssertionError: Special characters rendering failed + "tests/drawcustom/text_test.py::test_text_percentage" # AssertionError: Text with percentage rendering failed + "tests/drawcustom/text_test.py::test_text_anchors" # AssertionError: Text anchor points failed + "tests/drawcustom/text_test.py::test_text_truncate" # AssertionError: Text truncation failed + ]; + + meta = { + description = "Home Assistant Integration for OpenDisplay"; + homepage = "https://github.com/OpenDisplay/Home_Assistant_Integration"; + changelog = "https://github.com/OpenDisplay/Home_Assistant_Integration/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ hexa ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0b679e3516fd..c6c84a1a73ee 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16201,6 +16201,8 @@ self: super: with self; { python-registry = callPackage ../development/python-modules/python-registry { }; + python-resize-image = callPackage ../development/python-modules/python-resize-image { }; + python-ripple-api = callPackage ../development/python-modules/python-ripple-api { }; python-roborock = callPackage ../development/python-modules/python-roborock { };