From e59dd593c8ed9271c3f568a9972ed0a697731ca9 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 8 Oct 2021 23:25:26 +0200 Subject: [PATCH] python3Packages.smbus2: init at 0.4.1 --- .../python-modules/smbus2/default.nix | 41 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/python-modules/smbus2/default.nix diff --git a/pkgs/development/python-modules/smbus2/default.nix b/pkgs/development/python-modules/smbus2/default.nix new file mode 100644 index 000000000000..b3116bd3182e --- /dev/null +++ b/pkgs/development/python-modules/smbus2/default.nix @@ -0,0 +1,41 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, nose +, pythonOlder +}: + +buildPythonPackage rec { + pname = "smbus2"; + version = "0.4.1"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "kplindegaard"; + repo = pname; + rev = version; + sha256 = "0xgqs7bzhr8y3irc9gq3dnw1l3f5gc1yv4r2v4qxj95i3vvzpg5s"; + }; + + checkInputs = [ + nose + ]; + + checkPhase = '' + runHook preCheck + nosetests + runHook postCheck + ''; + + pythonImportsCheck = [ + "smbus2" + ]; + + meta = with lib; { + description = "Drop-in replacement for smbus-cffi/smbus-python"; + homepage = "https://smbus2.readthedocs.io/"; + license = licenses.mit; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 95af7eef4d72..4ce9523a34ac 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8437,6 +8437,8 @@ in { smbus-cffi = callPackage ../development/python-modules/smbus-cffi { }; + smbus2 = callPackage ../development/python-modules/smbus2 { }; + smdebug-rulesconfig = callPackage ../development/python-modules/smdebug-rulesconfig { }; smhi-pkg = callPackage ../development/python-modules/smhi-pkg { };