diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index c13400007c6d..93e71278ecf0 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -26222,6 +26222,12 @@ githubId = 18369995; keys = [ { fingerprint = "3D8C A43C FBA2 5D28 0196 19F0 AB11 0475 B417 291D"; } ]; }; + theconcierge = { + name = "TheConcierge"; + email = "therealconcierge@proton.me"; + github = "TheConcierge"; + githubId = 10949861; + }; thedavidmeister = { email = "thedavidmeister@gmail.com"; github = "thedavidmeister"; diff --git a/pkgs/development/python-modules/gpiodevice/default.nix b/pkgs/development/python-modules/gpiodevice/default.nix new file mode 100644 index 000000000000..8f29837fb3e8 --- /dev/null +++ b/pkgs/development/python-modules/gpiodevice/default.nix @@ -0,0 +1,58 @@ +{ + lib, + python, + buildPythonPackage, + pytestCheckHook, + fetchFromGitHub, + hatchling, + hatch-fancy-pypi-readme, + libgpiod, + mock, +}: +buildPythonPackage (finalAttrs: { + pname = "gpiodevice"; + version = "0.0.4"; + pyproject = true; + + src = fetchFromGitHub { + owner = "pimoroni"; + repo = "gpiodevice-python"; + tag = "v${finalAttrs.version}"; + hash = "sha256-1vZHRCHUmG+t0TYxYzc2qwElKrcLa0WmQ+FI5GTN1A8="; + }; + + build-system = [ + hatchling + hatch-fancy-pypi-readme + ]; + + dependencies = [ + libgpiod + ]; + + nativeCheckInputs = [ + mock + pytestCheckHook + ]; + + pythonImportsCheck = [ "gpiodevice" ]; + + # The build explicitly copies over these docs files, which cause collisions with other pimoroni repos. + # Preserve the files (especially license), but move elsewhere. + postInstall = '' + mkdir -p $out/share/doc/${finalAttrs.pname} + mkdir -p $out/share/licenses/${finalAttrs.pname} + + mv "$out/${python.sitePackages}/LICENSE" $out/share/licenses/${finalAttrs.pname} + mv "$out/${python.sitePackages}/README.md" $out/share/doc/${finalAttrs.pname}/ + mv "$out/${python.sitePackages}/CHANGELOG.md" $out/share/doc/${finalAttrs.pname}/ + ''; + + meta = { + description = "Helper library for working with Linux gpiochip devices"; + homepage = "https://github.com/pimoroni/gpiodevice-python"; + changelog = "https://github.com/pimoroni/gpiodevice-python/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ theconcierge ]; + }; +}) diff --git a/pkgs/development/python-modules/inky/default.nix b/pkgs/development/python-modules/inky/default.nix new file mode 100644 index 000000000000..ee90cb351eb5 --- /dev/null +++ b/pkgs/development/python-modules/inky/default.nix @@ -0,0 +1,64 @@ +{ + lib, + python, + buildPythonPackage, + pytestCheckHook, + fetchFromGitHub, + hatchling, + hatch-fancy-pypi-readme, + hatch-requirements-txt, + numpy, + pillow, + smbus2, + spidev, + gpiodevice, +}: +buildPythonPackage (finalAttrs: { + pname = "inky"; + version = "2.3.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "pimoroni"; + repo = "inky"; + tag = "v${finalAttrs.version}"; + hash = "sha256-1z2AZr6mlrl1O071iWS+tbWopUEUzLZe/QTmvl2atxQ="; + }; + + build-system = [ + hatchling + hatch-fancy-pypi-readme + hatch-requirements-txt + ]; + + dependencies = [ + numpy + pillow + smbus2 + spidev + gpiodevice + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "inky" ]; + + # The build explicitly copies over these docs files, which cause collisions with other pimoroni repos. + # Preserve the files (especially license), but move elsewhere. + postInstall = '' + mkdir -p $out/share/doc/${finalAttrs.pname} + mkdir -p $out/share/licenses/${finalAttrs.pname} + + mv "$out/${python.sitePackages}/LICENSE" $out/share/licenses/${finalAttrs.pname}/ + mv "$out/${python.sitePackages}/README.md" $out/share/doc/${finalAttrs.pname}/ + mv "$out/${python.sitePackages}/CHANGELOG.md" $out/share/doc/${finalAttrs.pname}/ + ''; + + meta = { + description = "Python library for Inky pHAT, Inky wHAT and Inky Impression e-paper displays for Raspberry Pi."; + homepage = "https://github.com/pimoroni/inky"; + changelog = "https://github.com/pimoroni/inky/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ theconcierge ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6d6d27c99c64..8e7c3ab75995 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6496,6 +6496,8 @@ self: super: with self; { gpib-ctypes = callPackage ../development/python-modules/gpib-ctypes { }; + gpiodevice = callPackage ../development/python-modules/gpiodevice { }; + gpiozero = callPackage ../development/python-modules/gpiozero { }; gprof2dot = callPackage ../development/python-modules/gprof2dot { inherit (pkgs) graphviz; }; @@ -7410,6 +7412,8 @@ self: super: with self; { inkex = callPackage ../development/python-modules/inkex { }; + inky = callPackage ../development/python-modules/inky { }; + inline-snapshot = callPackage ../development/python-modules/inline-snapshot { }; inotify = callPackage ../development/python-modules/inotify { };