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/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/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 ]; 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" diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0d2ec9d00a3..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 { }; @@ -8742,6 +8744,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 { };