diff --git a/pkgs/development/python-modules/pyflume/default.nix b/pkgs/development/python-modules/pyflume/default.nix new file mode 100644 index 00000000000..a1d36670a39 --- /dev/null +++ b/pkgs/development/python-modules/pyflume/default.nix @@ -0,0 +1,45 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +, pythonOlder +, pyjwt +, ratelimit +, pytz +, requests +, requests-mock +}: + +buildPythonPackage rec { + pname = "pyflume"; + version = "0.6.2"; + disabled = pythonOlder "3.7"; + + src = fetchFromGitHub { + owner = "ChrisMandich"; + repo = "PyFlume"; + rev = "v${version}"; + sha256 = "0i181c8722j831bjlcjwv5ccy20hl8zzlv7bfp8w0976gdmv4iz8"; + }; + + propagatedBuildInputs = [ + pyjwt + ratelimit + pytz + requests + ]; + + checkInputs = [ + requests-mock + pytestCheckHook + ]; + + pythonImportsCheck = [ "pyflume" ]; + + meta = with lib; { + description = "Python module to work with Flume sensors"; + homepage = "https://github.com/ChrisMandich/PyFlume"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/development/python-modules/ratelimit/default.nix b/pkgs/development/python-modules/ratelimit/default.nix new file mode 100644 index 00000000000..f706d043bf8 --- /dev/null +++ b/pkgs/development/python-modules/ratelimit/default.nix @@ -0,0 +1,34 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "ratelimit"; + version = "2.2.1"; + + src = fetchFromGitHub { + owner = "tomasbasham"; + repo = pname; + rev = "v${version}"; + sha256 = "04hy3hhh5xdqcsz0lx8j18zbj88kh5ik4wyi5d3a5sfy2hx70in2"; + }; + + postPatch = '' + sed -i "/--cov/d" pytest.ini + ''; + + checkInputs = [ pytestCheckHook ]; + + pytestFlagsArray = [ "tests" ]; + + pythonImportsCheck = [ "ratelimit" ]; + + meta = with lib; { + description = "Python API Rate Limit Decorator"; + homepage = "https://github.com/tomasbasham/ratelimit"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index db0fd858f0f..a4e480c4550 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -264,7 +264,7 @@ "flick_electric" = ps: with ps; [ ]; # missing inputs: PyFlick "flo" = ps: with ps; [ aioflo ]; "flock" = ps: with ps; [ ]; - "flume" = ps: with ps; [ ]; # missing inputs: pyflume + "flume" = ps: with ps; [ pyflume ]; "flunearyou" = ps: with ps; [ ]; # missing inputs: pyflunearyou "flux" = ps: with ps; [ ]; "flux_led" = ps: with ps; [ flux-led ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 38e1f73e915..88b66b1420e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5464,6 +5464,8 @@ in { pyflakes = callPackage ../development/python-modules/pyflakes { }; + pyflume = callPackage ../development/python-modules/pyflume { }; + pyfma = callPackage ../development/python-modules/pyfma { }; pyfribidi = callPackage ../development/python-modules/pyfribidi { }; @@ -6747,6 +6749,8 @@ in { rasterio = callPackage ../development/python-modules/rasterio { gdal = pkgs.gdal_2; }; # gdal 3.0 not supported yet + ratelimit = callPackage ../development/python-modules/ratelimit { }; + ratelimiter = callPackage ../development/python-modules/ratelimiter { }; raven = callPackage ../development/python-modules/raven { };