From fb9725692f7b765617a800bdc92d9b4cc37f69d0 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 25 Sep 2021 23:51:03 +0200 Subject: [PATCH 1/4] python3Packages.asynccmd: init at 0.2.4 --- .../python-modules/asynccmd/default.nix | 42 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 44 insertions(+) create mode 100644 pkgs/development/python-modules/asynccmd/default.nix diff --git a/pkgs/development/python-modules/asynccmd/default.nix b/pkgs/development/python-modules/asynccmd/default.nix new file mode 100644 index 000000000000..623424047429 --- /dev/null +++ b/pkgs/development/python-modules/asynccmd/default.nix @@ -0,0 +1,42 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, fetchpatch +, pythonOlder +}: + +buildPythonPackage rec { + pname = "asynccmd"; + version = "0.2.4"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "valentinmk"; + repo = pname; + rev = version; + sha256 = "02sa0k0zgwv0y8k00pd1yh4x7k7xqhdikk2c0avpih1204lcw26h"; + }; + + patches = [ + # Deprecation of asyncio.Task.all_tasks(), https://github.com/valentinmk/asynccmd/pull/2 + (fetchpatch { + name = "deprecation-python-38.patch"; + url = "https://github.com/valentinmk/asynccmd/commit/12afa60ac07db17e96755e266061f2c88cb545ff.patch"; + sha256 = "0l6sk93gj51qqrpw01a8iiyz14k6dd2z68vr9l9w9vx76l8725yf"; + }) + ]; + + # Tests are outdated + doCheck = false; + + pythonImportsCheck = [ "asynccmd" ]; + + meta = with lib; { + description = "Asyncio implementation of Cmd Python library"; + homepage = "https://github.com/valentinmk/asynccmd"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 50803af17df7..ea0afb1f5033 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -613,6 +613,8 @@ in { async-lru = callPackage ../development/python-modules/async-lru { }; + asynccmd = callPackage ../development/python-modules/asynccmd { }; + asyncio-dgram = callPackage ../development/python-modules/asyncio-dgram { }; asyncio-mqtt = callPackage ../development/python-modules/asyncio_mqtt { }; From 9c0e8584e9fd1ed8e1faa5e09097916f7e387730 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 25 Sep 2021 23:54:37 +0200 Subject: [PATCH 2/4] home-assistant: update component-packages --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index b1363880f9f8..ab4c36563519 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -806,7 +806,7 @@ "sony_projector" = ps: with ps; [ ]; # missing inputs: pysdcp "soundtouch" = ps: with ps; [ aiohttp-cors ifaddr libsoundtouch zeroconf ]; "spaceapi" = ps: with ps; [ aiohttp-cors ]; - "spc" = ps: with ps; [ ]; # missing inputs: pyspcwebgw + "spc" = ps: with ps; [ pyspcwebgw ]; "speedtestdotnet" = ps: with ps; [ speedtest-cli ]; "spider" = ps: with ps; [ spiderpy ]; "splunk" = ps: with ps; [ ]; # missing inputs: hass_splunk From c9ebf4ed8001e51fdbf976862a2f04d9d580f9b9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 25 Sep 2021 23:56:04 +0200 Subject: [PATCH 3/4] home-assistant: enable spc tests --- pkgs/servers/home-assistant/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/home-assistant/default.nix b/pkgs/servers/home-assistant/default.nix index 27c34e10e382..da9cc95afc20 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -628,6 +628,7 @@ in with py.pkgs; buildPythonApplication rec { # "sonos" "soundtouch" "spaceapi" + "spc" "speedtestdotnet" "spider" "spotify" From d472c9d87c6fea330660c2bc079e0e6b607e4c40 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 26 Sep 2021 00:16:31 +0200 Subject: [PATCH 4/4] python3Packages.pyspcwebgw: init at 0.5.0 --- .../python-modules/pyspcwebgw/default.nix | 46 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 48 insertions(+) create mode 100644 pkgs/development/python-modules/pyspcwebgw/default.nix diff --git a/pkgs/development/python-modules/pyspcwebgw/default.nix b/pkgs/development/python-modules/pyspcwebgw/default.nix new file mode 100644 index 000000000000..8c901f17747a --- /dev/null +++ b/pkgs/development/python-modules/pyspcwebgw/default.nix @@ -0,0 +1,46 @@ +{ lib +, aiohttp +, aioresponses +, asynccmd +, buildPythonPackage +, fetchFromGitHub +, pytest-asyncio +, pytestCheckHook +, pythonOlder +, requests +}: + +buildPythonPackage rec { + pname = "pyspcwebgw"; + version = "0.5.0"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "mbrrg"; + repo = pname; + rev = "v${version}"; + sha256 = "0pc25myjc2adqcx2lbns9kw0gy17x1qjgicmfj46n6fn0c786p9v"; + }; + + propagatedBuildInputs = [ + asynccmd + aiohttp + ]; + + checkInputs = [ + aioresponses + pytest-asyncio + pytestCheckHook + ]; + + pythonImportsCheck = [ "pyspcwebgw" ]; + + meta = with lib; { + description = "Python module for the SPC Web Gateway REST API"; + homepage = "https://github.com/mbrrg/pyspcwebgw"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ea0afb1f5033..1f152ef0b097 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6893,6 +6893,8 @@ in { pysparse = callPackage ../development/python-modules/pysparse { }; + pyspcwebgw = callPackage ../development/python-modules/pyspcwebgw { }; + pyspf = callPackage ../development/python-modules/pyspf { }; pyspice = callPackage ../development/python-modules/pyspice { };