From 667777bf0f2d92ebc17324397614c8b8af4ece7f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 1 May 2024 09:54:32 +0200 Subject: [PATCH 1/2] python312Packages.uart-devices: init at 0.1.0 UART Devices for Linux https://github.com/bdraco/uart-devices --- .../python-modules/uart-devices/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/uart-devices/default.nix diff --git a/pkgs/development/python-modules/uart-devices/default.nix b/pkgs/development/python-modules/uart-devices/default.nix new file mode 100644 index 000000000000..171bf2b66001 --- /dev/null +++ b/pkgs/development/python-modules/uart-devices/default.nix @@ -0,0 +1,47 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, poetry-core +, pytest-asyncio +, pythonOlder +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "uart-devices"; + version = "0.1.0"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "bdraco"; + repo = "uart-devices"; + rev = "refs/tags/v${version}"; + hash = "sha256-rmOWyTdOwnlr8Rwsvd2oeZq79LuGVJDAkIW2/9gGrKQ="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace-fail "-Wdefault --cov=uart_devices --cov-report=term-missing:skip-covered" "" + ''; + + nativeBuildInputs = [ + poetry-core + ]; + + nativeCheckInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + pythonImportsCheck = [ "uart_devices" ]; + + meta = with lib; { + description = "UART Devices for Linux"; + homepage = "https://github.com/bdraco/uart-devices"; + changelog = "https://github.com/bdraco/uart-devices/blob/${version}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 092730d89008..b902c42ba0c8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16288,6 +16288,8 @@ self: super: with self; { uarray = callPackage ../development/python-modules/uarray { }; + uart-devices = callPackage ../development/python-modules/uart-devices { }; + uasiren = callPackage ../development/python-modules/uasiren { }; ubelt = callPackage ../development/python-modules/ubelt { }; From 04f503bbdda109a894f3999025628b51c357f755 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 1 May 2024 12:58:02 +0200 Subject: [PATCH 2/2] python312Packages.uart-devices: set to linux --- pkgs/development/python-modules/uart-devices/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/uart-devices/default.nix b/pkgs/development/python-modules/uart-devices/default.nix index 171bf2b66001..7859d5ce32d1 100644 --- a/pkgs/development/python-modules/uart-devices/default.nix +++ b/pkgs/development/python-modules/uart-devices/default.nix @@ -43,5 +43,6 @@ buildPythonPackage rec { changelog = "https://github.com/bdraco/uart-devices/blob/${version}/CHANGELOG.md"; license = licenses.mit; maintainers = with maintainers; [ fab ]; + platforms = platforms.linux; }; }