From 6529116b050880742d7d3fa578cf64ae3fcbe9f7 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 5 Dec 2021 13:42:01 +0100 Subject: [PATCH] python3Packages.reolink: init at 0.0.53 --- .../python-modules/reolink/default.nix | 67 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 69 insertions(+) create mode 100644 pkgs/development/python-modules/reolink/default.nix diff --git a/pkgs/development/python-modules/reolink/default.nix b/pkgs/development/python-modules/reolink/default.nix new file mode 100644 index 000000000000..3616eb1e3c0f --- /dev/null +++ b/pkgs/development/python-modules/reolink/default.nix @@ -0,0 +1,67 @@ +{ lib +, aiohttp +, aiounittest +, buildPythonPackage +, fetchFromGitHub +, ffmpeg-python +, pytestCheckHook +, pythonOlder +, requests +}: + +buildPythonPackage rec { + pname = "reolink"; + version = "0.0.53"; + format = "setuptools"; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "fwestenberg"; + repo = pname; + # https://github.com/fwestenberg/reolink/issues/78 + rev = "0053"; + sha256 = "sha256-kEG+kRTWaC6eQbmlasAWIESFdKPoxQCdZLRrQwb2aRU="; + }; + + propagatedBuildInputs = [ + aiohttp + ffmpeg-python + requests + ]; + + checkInputs = [ + aiounittest + pytestCheckHook + ]; + + postPatch = '' + # Packages in nixpkgs is different than the module name + substituteInPlace setup.py \ + --replace "ffmpeg" "ffmpeg-python" + ''; + + pytestFlagsArray = [ + "test.py" + ]; + + disabledTests = [ + # Tests require network access + "test1_settings" + "test2_states" + "test3_images" + "test4_properties" + "test_succes" + ]; + + pythonImportsCheck = [ + "reolink" + ]; + + meta = with lib; { + description = "Python module to interact with the Reolink IP camera API"; + homepage = "https://github.com/fwestenberg/reolink"; + 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 6569bf250ddb..6ac71e1240e8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8194,6 +8194,8 @@ in { rencode = callPackage ../development/python-modules/rencode { }; + reolink = callPackage ../development/python-modules/reolink { }; + reparser = callPackage ../development/python-modules/reparser { }; repeated_test = callPackage ../development/python-modules/repeated_test { };