From 25ede38d35a5317b7768fc839faf8951e308b2ba Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 12 Nov 2022 12:49:15 +0100 Subject: [PATCH 1/8] python310Packages.umodbus: init at 1.0.4 --- .../python-modules/umodbus/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/umodbus/default.nix diff --git a/pkgs/development/python-modules/umodbus/default.nix b/pkgs/development/python-modules/umodbus/default.nix new file mode 100644 index 000000000000..845548dcb790 --- /dev/null +++ b/pkgs/development/python-modules/umodbus/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pyserial +, pytestCheckHook +, pythonOlder +, setuptools +}: + +buildPythonPackage rec { + pname = "umodbus"; + version = "1.0.4"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "AdvancedClimateSystems"; + repo = "uModbus"; + rev = "refs/tags/${version}"; + hash = "sha256-5IXadb5mjrMwr+L9S1iMN5kba5VGrzYt1p8nBvvLCh4="; + }; + + propagatedBuildInputs = [ + pyserial + ]; + + checkInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ + "umodbus" + ]; + + meta = with lib; { + description = "Implementation of the Modbus protocol"; + homepage = "https://github.com/AdvancedClimateSystems/uModbus/"; + license = with licenses; [ mpl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index af0c07084a9f..f6e4201a21f1 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11470,6 +11470,8 @@ self: super: with self; { umap-learn = callPackage ../development/python-modules/umap-learn { }; + umodbus = callPackage ../development/python-modules/umodbus { }; + u-msgpack-python = callPackage ../development/python-modules/u-msgpack-python { }; unasync = callPackage ../development/python-modules/unasync { }; From 26640709430fb8afa54f82f93f8f7b1f460e49c3 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 12 Nov 2022 13:07:30 +0100 Subject: [PATCH 2/8] python310Packages.sockio: init at 0.15.0 --- .../python-modules/sockio/default.nix | 80 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 82 insertions(+) create mode 100644 pkgs/development/python-modules/sockio/default.nix diff --git a/pkgs/development/python-modules/sockio/default.nix b/pkgs/development/python-modules/sockio/default.nix new file mode 100644 index 000000000000..6476c88c31a6 --- /dev/null +++ b/pkgs/development/python-modules/sockio/default.nix @@ -0,0 +1,80 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytest-asyncio +, pytestCheckHook +, pythonOlder +}: + +buildPythonPackage rec { + pname = "sockio"; + version = "0.15.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "tiagocoutinho"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-NSGd7/k1Yr408dipMNBSPRSwQ+wId7VLxgqMM/UmN/Q="; + }; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace "--cov-config=.coveragerc --cov sockio" "" \ + --replace "--cov-report html --cov-report term" "" \ + --replace "--durations=2 --verbose" "" + ''; + + checkInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + pythonImportsCheck = [ + "sockio" + ]; + + disabledTests = [ + # Tests require network access + "test_open_timeout" + "test_write_readline_error" + "test_open_close" + "test_callbacks" + "test_coroutine_callbacks" + "test_error_callback" + "test_eof_callback" + "test_write_read" + "test_write_readline" + "test_write_readlines" + "test_writelines_readlines" + "test_writelines" + "test_readline" + "test_readuntil" + "test_readexactly" + "test_readlines" + "test_read" + "test_readbuffer" + "test_parallel_rw" + "test_parallel" + "test_stream" + "test_timeout" + "test_line_stream" + "test_block_stream" + "test_socket_for_url" + "test_root_socket_for_url" + ]; + + disabledTestPaths = [ + # We don't care about Python 2.x + "tests/test_py2.py" + ]; + + meta = with lib; { + description = "Implementation of the Modbus protocol"; + homepage = "https://tiagocoutinho.github.io/sockio/"; + license = with licenses; [ gpl3Plus ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f6e4201a21f1..a5e9dc243642 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10362,6 +10362,8 @@ self: super: with self; { socid-extractor = callPackage ../development/python-modules/socid-extractor { }; + sockio = callPackage ../development/python-modules/sockio { }; + sockjs = callPackage ../development/python-modules/sockjs { }; sockjs-tornado = callPackage ../development/python-modules/sockjs-tornado { }; From 4c15dad466d6d938db27af91df765d61c4b99be6 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 12 Nov 2022 13:13:25 +0100 Subject: [PATCH 3/8] python310Packages.serialio: init at 2.4.0 --- .../python-modules/serialio/default.nix | 43 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 45 insertions(+) create mode 100644 pkgs/development/python-modules/serialio/default.nix diff --git a/pkgs/development/python-modules/serialio/default.nix b/pkgs/development/python-modules/serialio/default.nix new file mode 100644 index 000000000000..56f82e449a70 --- /dev/null +++ b/pkgs/development/python-modules/serialio/default.nix @@ -0,0 +1,43 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, pyserial +, sockio +}: + +buildPythonPackage rec { + pname = "serialio"; + version = "2.4.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "tiagocoutinho"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-9TRGT0wpoRRcHqnH1XzlMBh0IcVzdEcOzN7hkeYnoW4="; + }; + + propagatedBuildInputs = [ + pyserial + sockio + ]; + + # Module has no tests + doCheck = false; + + pythonImportsCheck = [ + "serialio" + ]; + + meta = with lib; { + description = "Library for concurrency agnostic serial connunication"; + homepage = "https://github.com/tiagocoutinho/serialio"; + license = with licenses; [ gpl3Plus ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a5e9dc243642..18bd08e8db95 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10098,6 +10098,8 @@ self: super: with self; { pythonSupport = true; })); + serialio = callPackage ../development/python-modules/serialio { }; + serpent = callPackage ../development/python-modules/serpent { }; serpy = callPackage ../development/python-modules/serpy { }; From 3e93dfa004167d0398c2693677e5fd5a42ac9a4a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 12 Nov 2022 13:19:20 +0100 Subject: [PATCH 4/8] python310Packages.connio: init at 0.2.0 --- .../python-modules/connio/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/connio/default.nix diff --git a/pkgs/development/python-modules/connio/default.nix b/pkgs/development/python-modules/connio/default.nix new file mode 100644 index 000000000000..14574ab9da33 --- /dev/null +++ b/pkgs/development/python-modules/connio/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +, serialio +, sockio +}: + +buildPythonPackage rec { + pname = "connio"; + version = "0.2.0"; + format = "setuptools"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "tiagocoutinho"; + repo = pname; + rev = "refs/tags/v${version}"; + hash = "sha256-fPM7Ya69t0jpZhKM2MTk6BwjvoW3a8SV3k000LB9Ypo="; + }; + + propagatedBuildInputs = [ + serialio + sockio + ]; + + # Module has no tests + doCheck = false; + + pythonImportsCheck = [ + "connio" + ]; + + meta = with lib; { + description = "Library for concurrency agnostic communication"; + homepage = "https://github.com/tiagocoutinho/connio"; + license = with licenses; [ gpl3Plus ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 18bd08e8db95..b21411a29b28 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1564,6 +1564,8 @@ self: super: with self; { connection-pool = callPackage ../development/python-modules/connection-pool { }; + connio = callPackage ../development/python-modules/connio { }; + coqpit = callPackage ../development/python-modules/coqpit { }; coqui-trainer = callPackage ../development/python-modules/coqui-trainer {}; From 14eadb17dfdcff49b7e6dc766faebc9e8bd928d2 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 12 Nov 2022 13:30:51 +0100 Subject: [PATCH 5/8] python310Packages.async-modbus: init at 0.2.0 --- .../python-modules/async-modbus/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/async-modbus/default.nix diff --git a/pkgs/development/python-modules/async-modbus/default.nix b/pkgs/development/python-modules/async-modbus/default.nix new file mode 100644 index 000000000000..84423c6afbbc --- /dev/null +++ b/pkgs/development/python-modules/async-modbus/default.nix @@ -0,0 +1,57 @@ +{ lib +, buildPythonPackage +, connio +, fetchFromGitHub +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, setuptools +, umodbus +}: + +buildPythonPackage rec { + pname = "async-modbus"; + version = "0.2.0"; + format = "pyproject"; + + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "tiagocoutinho"; + repo = "async_modbus"; + rev = "refs/tags/v${version}"; + hash = "sha256-TB+ndUvLZ9G3XXEBpLb4ULHlYZC2CoqGnL2BjMQrhRg="; + }; + + postPatch = '' + substituteInPlace pyproject.toml \ + --replace '"--cov=async_modbus",' "" \ + --replace '"--cov-report=html", "--cov-report=term",' "" \ + --replace '"--durations=2", "--verbose"' "" + ''; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + connio + umodbus + ]; + + checkInputs = [ + pytest-asyncio + pytestCheckHook + ]; + + pythonImportsCheck = [ + "async_modbus" + ]; + + meta = with lib; { + description = "Library for Modbus communication"; + homepage = "https://github.com/tiagocoutinho/async_modbus"; + license = with licenses; [ gpl3Plus ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b21411a29b28..9838f18bbcb7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -666,6 +666,8 @@ self: super: with self; { async-lru = callPackage ../development/python-modules/async-lru { }; + async-modbus = callPackage ../development/python-modules/async-modbus { }; + asyncclick = callPackage ../development/python-modules/asyncclick { }; asynccmd = callPackage ../development/python-modules/asynccmd { }; From e8536675c986d6e27df751e6ef308885925e9b16 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 12 Nov 2022 13:46:01 +0100 Subject: [PATCH 6/8] python310Packages.nibe: init at 1.2.1 --- .../python-modules/nibe/default.nix | 57 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 59 insertions(+) create mode 100644 pkgs/development/python-modules/nibe/default.nix diff --git a/pkgs/development/python-modules/nibe/default.nix b/pkgs/development/python-modules/nibe/default.nix new file mode 100644 index 000000000000..4a3ce21b82a7 --- /dev/null +++ b/pkgs/development/python-modules/nibe/default.nix @@ -0,0 +1,57 @@ +{ lib +, aiohttp +, aresponses +, async-modbus +, async-timeout +, buildPythonPackage +, construct +, fetchFromGitHub +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, setuptools +, tenacity +}: + +buildPythonPackage rec { + pname = "nibe"; + version = "1.2.1"; + format = "pyproject"; + + disabled = pythonOlder "3.9"; + + src = fetchFromGitHub { + owner = "yozik04"; + repo = pname; + rev = "refs/tags/${version}"; + hash = "sha256-y1/yZE5Gfj2XPscZ27TNXOM/VGy/iIFkvg2TCNsh4tI="; + }; + + nativeBuildInputs = [ + setuptools + ]; + + propagatedBuildInputs = [ + async-modbus + async-timeout + construct + tenacity + ]; + + checkInputs = [ + aresponses + pytest-asyncio + pytestCheckHook + ]; + + pythonImportsCheck = [ + "nibe" + ]; + + meta = with lib; { + description = "Library for the communication with Nibe heatpumps"; + homepage = "https://github.com/yozik04/nibe"; + license = with licenses; [ gpl3Plus ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9838f18bbcb7..6b1c53d1e4be 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6137,6 +6137,8 @@ self: super: with self; { nibabel = callPackage ../development/python-modules/nibabel { }; + nibe = callPackage ../development/python-modules/nibe { }; + nidaqmx = callPackage ../development/python-modules/nidaqmx { }; Nikola = callPackage ../development/python-modules/Nikola { }; From dd96d8ffbb266fee9021e4f985fa0b75a5730e1c Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 12 Nov 2022 13:46:07 +0100 Subject: [PATCH 7/8] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 4ba82df927e0..c2974f0f4e0d 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -2128,8 +2128,9 @@ "nfandroidtv" = ps: with ps; [ ]; # missing inputs: notifications-android-tv "nibe_heatpump" = ps: with ps; [ + nibe tenacity - ]; # missing inputs: nibe + ]; "nightscout" = ps: with ps; [ py-nightscout ]; @@ -4144,6 +4145,7 @@ "nexia" "nextbus" "nextdns" + "nibe_heatpump" "nightscout" "nina" "nmap_tracker" From 5be6a3f42cf7fc652f03b28fe47349609f5222f0 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 12 Nov 2022 14:00:26 +0100 Subject: [PATCH 8/8] home-assistant: pin nibe at 0.5.0 --- pkgs/servers/home-assistant/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 6eca3b16bdf6..270e5269306b 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -62,6 +62,16 @@ let }; }); + nibe = super.nibe.overridePythonAttrs (oldAttrs: rec { + version = "0.5.0"; + src = fetchFromGitHub { + owner = "yozik04"; + repo = "nibe"; + rev = "refs/tags/${version}"; + hash = "sha256-DguGWNJfc5DfbcKMX2eMM2U1WyVPcdtv2BmpVloOFSU="; + }; + }); + # pytest-aiohttp>0.3.0 breaks home-assistant tests pytest-aiohttp = super.pytest-aiohttp.overridePythonAttrs (oldAttrs: rec { version = "0.3.0";