1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, nose
5, pythonOlder
6}:
7
8buildPythonPackage rec {
9 pname = "smbus2";
10 version = "0.4.2";
11
12 disabled = pythonOlder "3.6";
13
14 src = fetchFromGitHub {
15 owner = "kplindegaard";
16 repo = pname;
17 rev = "refs/tags/${version}";
18 sha256 = "sha256-6JzFbhUq8XR1nYkadPeYqItcLZDIFAwTe3BriEW2nVI=";
19 };
20
21 checkInputs = [
22 nose
23 ];
24
25 checkPhase = ''
26 runHook preCheck
27 nosetests
28 runHook postCheck
29 '';
30
31 pythonImportsCheck = [
32 "smbus2"
33 ];
34
35 meta = with lib; {
36 description = "Drop-in replacement for smbus-cffi/smbus-python";
37 homepage = "https://smbus2.readthedocs.io/";
38 license = licenses.mit;
39 maintainers = with maintainers; [ fab ];
40 };
41}