Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / smbus-cffi / default.nix
blobb32cde3a87a4b25e791836193cea562de0732dc5
1 { lib
2 , buildPythonPackage
3 , fetchPypi
4 , cffi
5 , py
6 , pytestCheckHook
7 , pyserial
8 , fetchpatch
9 }:
11 buildPythonPackage rec {
12   pname = "smbus-cffi";
13   version = "0.5.1";
14   format = "setuptools";
16   src = fetchPypi {
17     inherit pname version;
18     sha256 = "fb4195aaabfc01586863f60d3190b5cb1bf8f12622fd597e23e48768dad6bde8";
19   };
21   patches = [
22     # https://github.com/bivab/smbus-cffi/pull/24
23     (fetchpatch {
24       url = "https://github.com/bivab/smbus-cffi/commit/ba79ae174a9d84e767d95f165c43ee212b1bbb92.patch";
25       hash = "sha256-WtRuK5y6fWDEhm0Xy5XqS5yCkn7vXXYtjlOjS90gla4=";
26     })
27   ];
29   propagatedNativeBuildInputs = [ cffi ];
31   propagatedBuildInputs = [ cffi ];
33   installCheckPhase = ''
34     # we want to import the installed module that also contains the compiled library
35     rm -rf smbus
36     runHook pytestCheckPhase
37   '';
39   # requires hardware access
40   pytestFlagsArray = [ "--ignore=test/test_smbus_integration.py" ];
42   nativeCheckInputs = [ py pytestCheckHook pyserial ];
44   meta = with lib; {
45     description = "Python module for SMBus access through Linux I2C /dev interface";
46     homepage = "https://github.com/bivab/smbus-cffi";
47     license = licenses.gpl2;
48     maintainers = with maintainers; [ mic92 ];
49     platforms = platforms.linux;
50   };