diff --git a/pkgs/development/python-modules/rgbxy/default.nix b/pkgs/development/python-modules/rgbxy/default.nix new file mode 100644 index 000000000000..df9b072c3ae7 --- /dev/null +++ b/pkgs/development/python-modules/rgbxy/default.nix @@ -0,0 +1,37 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + setuptools, +}: + +buildPythonPackage (finalAttrs: { + pname = "rgbxy"; + # version 0.5 suffix is based upon pypi version not tagged on GitHub, see: + # - https://pypi.org/project/rgbxy/ + # - https://github.com/benknight/hue-python-rgb-converter/tags + version = "0.5-unstable-2025-12-16"; + pyproject = true; + + src = fetchFromGitHub { + owner = "benknight"; + repo = "hue-python-rgb-converter"; + rev = "22a09c3c7d395b6e7b91b5f82944ccf1a7e9e47a"; + hash = "sha256-J14vg/kDF1TuLt6kTNHN/5qxqDHbxkdGkqEAn3V57nU="; + }; + + build-system = [ + setuptools + ]; + + pythonImportsCheck = [ + "rgbxy" + ]; + + meta = { + description = "RGB conversion tool written in Python for Philips Hue"; + homepage = "https://github.com/benknight/hue-python-rgb-converter"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ doronbehar ]; + }; +}) diff --git a/pkgs/development/python-modules/rich-tables/default.nix b/pkgs/development/python-modules/rich-tables/default.nix index 2c7d29b51316..7fd8038aa9d8 100644 --- a/pkgs/development/python-modules/rich-tables/default.nix +++ b/pkgs/development/python-modules/rich-tables/default.nix @@ -1,29 +1,39 @@ { lib, buildPythonPackage, - fetchPypi, + fetchFromGitHub, + + # build-system poetry-core, + + # dependencies coloraide, + decorator, humanize, multimethod, platformdirs, rich, sqlparse, typing-extensions, - rgbxy ? null, + + # tests + pytestCheckHook, + pytest-cov-stub, + freezegun, + + # passthru + rgbxy, }: -let - version = "0.8.0"; -in -buildPythonPackage { +buildPythonPackage (finalAttrs: { pname = "rich-tables"; - inherit version; + version = "0.9.0"; pyproject = true; - src = fetchPypi { - pname = "rich_tables"; - inherit version; - hash = "sha256-MN8QH6kLyogbcQ0VE9U034cwSFnaFDB2/Rnvy1DYyl4="; + src = fetchFromGitHub { + owner = "snejus"; + repo = "rich-tables"; + tag = finalAttrs.version; + hash = "sha256-6sXWrFP8TDBcFaGCymsZfHL8bfsRbj63VZCeY1H6h/Y="; }; build-system = [ @@ -32,6 +42,7 @@ buildPythonPackage { dependencies = [ coloraide + decorator humanize multimethod platformdirs @@ -40,6 +51,13 @@ buildPythonPackage { typing-extensions ]; + nativeBuildInputs = [ + pytestCheckHook + pytest-cov-stub + freezegun + ] + ++ finalAttrs.finalPackage.passthru.optional-dependencies.hue; + optional-dependencies = { hue = [ rgbxy @@ -63,4 +81,4 @@ buildPythonPackage { ]; mainProgram = "table"; }; -} +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9c61ca27f5e5..8e0046d0b7a7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16925,6 +16925,8 @@ self: super: with self; { rflink = callPackage ../development/python-modules/rflink { }; + rgbxy = callPackage ../development/python-modules/rgbxy { }; + rgpio = toPythonModule ( pkgs.lgpio.override { inherit buildPythonPackage;