From a5212a77273d423433ee11e2dda4d8c17fe540ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 19 Jun 2021 18:00:50 +0200 Subject: [PATCH 1/4] pythonPackages.unasync: init at 0.5.0 --- .../python-modules/unasync/default.nix | 45 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/unasync/default.nix diff --git a/pkgs/development/python-modules/unasync/default.nix b/pkgs/development/python-modules/unasync/default.nix new file mode 100644 index 00000000000..9b37edfb284 --- /dev/null +++ b/pkgs/development/python-modules/unasync/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, setuptools +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "unasync"; + version = "0.5.0"; + + format = "pyproject"; + + src = fetchFromGitHub { + owner = "python-trio"; + repo = "unasync"; + rev = "v${version}"; + sha256 = "0h86i09v4909a8nk5lp36jlwz6rsln6vyg3d0i13ykxa6lrx1c2l"; + }; + + propagatedBuildInputs = [ + setuptools + ]; + + checkInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + # mess with $PYTHONPATH + "test_build_py_modules" + "test_build_py_packages" + "test_project_structure_after_build_py_packages" + "test_project_structure_after_customized_build_py_packages" + ]; + + pythonImportsCheck = [ "unasync" ]; + + meta = with lib; { + description = "Project that can transform your asynchronous code into synchronous code"; + homepage = "https://github.com/python-trio/unasync"; + license = with licenses; [ mit /* or */ asl20 ]; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0d2ec9d00a3..9921f278d55 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8742,6 +8742,8 @@ in { u-msgpack-python = callPackage ../development/python-modules/u-msgpack-python { }; + unasync = callPackage ../development/python-modules/unasync { }; + uncertainties = callPackage ../development/python-modules/uncertainties { }; uncompyle6 = callPackage ../development/python-modules/uncompyle6 { }; From 6420b66f0b37d9b6d154e4a5ededdf9f440231ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 19 Jun 2021 18:10:36 +0200 Subject: [PATCH 2/4] python3Packages.pyhiveapi: init at 0.4.2 --- .../python-modules/pyhiveapi/default.nix | 63 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 65 insertions(+) create mode 100644 pkgs/development/python-modules/pyhiveapi/default.nix diff --git a/pkgs/development/python-modules/pyhiveapi/default.nix b/pkgs/development/python-modules/pyhiveapi/default.nix new file mode 100644 index 00000000000..96b361d0271 --- /dev/null +++ b/pkgs/development/python-modules/pyhiveapi/default.nix @@ -0,0 +1,63 @@ +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, unasync +, boto3 +, botocore +, requests +, aiohttp +, pyquery +, loguru +}: + +buildPythonPackage rec { + pname = "pyhiveapi"; + version = "0.4.2"; + + format = "pyproject"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "Pyhass"; + repo = "Pyhiveapi"; + rev = "v${version}"; + sha256 = "0x9cfxfdpccz360azpyfhvn09xxkw7vxy42npgbqhpy2g6mh5sif"; + }; + + postPatch = '' + substituteInPlace requirements.txt \ + --replace "pre-commit" "" + ''; + + nativeBuildInputs = [ + unasync + ]; + + propagatedBuildInputs = [ + boto3 + botocore + requests + aiohttp + pyquery + loguru + ]; + + # tests are not functional yet + doCheck = false; + + postBuild = '' + # pyhiveapi accesses $HOME upon importing + export HOME=$TMPDIR + ''; + + pythonImportsCheck = [ "pyhiveapi" ]; + + meta = with lib; { + description = "Python library to interface with the Hive API"; + homepage = "https://github.com/Pyhass/Pyhiveapi"; + license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9921f278d55..d3c455f41fe 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5268,6 +5268,8 @@ in { pyheos = callPackage ../development/python-modules/pyheos { }; + pyhiveapi = callPackage ../development/python-modules/pyhiveapi { }; + pynndescent = callPackage ../development/python-modules/pynndescent { }; pynobo = callPackage ../development/python-modules/pynobo { }; From ef27876d15e8263c8bc1ba73f0f7695e7d600556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 19 Jun 2021 18:11:45 +0200 Subject: [PATCH 3/4] home-assistant: update component-packages.nix --- 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 a72010eeafd..62684b3c0ba 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -352,7 +352,7 @@ "history" = ps: with ps; [ aiohttp-cors sqlalchemy ]; "history_stats" = ps: with ps; [ sqlalchemy ]; "hitron_coda" = ps: with ps; [ ]; - "hive" = ps: with ps; [ ]; # missing inputs: pyhiveapi + "hive" = ps: with ps; [ pyhiveapi ]; "hlk_sw16" = ps: with ps; [ ]; # missing inputs: hlk-sw16 "home_connect" = ps: with ps; [ aiohttp-cors homeconnect ]; "home_plus_control" = ps: with ps; [ aiohttp-cors homepluscontrol ]; From 6498fb43a62654131a64cb9304d75183f8923ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 19 Jun 2021 18:13:04 +0200 Subject: [PATCH 4/4] home-assistant: test hive component --- 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 d812c1539c6..53cb0cac843 100644 --- a/pkgs/servers/home-assistant/default.nix +++ b/pkgs/servers/home-assistant/default.nix @@ -443,6 +443,7 @@ in with py.pkgs; buildPythonApplication rec { "heos" "history" "history_stats" + "hive" "home_connect" "home_plus_control" "homeassistant"