biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / smbus-cffi / default.nix
blob7d76327862c9d88b1df34e67d04f8df1f8f0bae5
2   lib,
3   buildPythonPackage,
4   fetchPypi,
5   cffi,
6   py,
7   pytestCheckHook,
8   pyserial,
9   fetchpatch,
12 buildPythonPackage rec {
13   pname = "smbus-cffi";
14   version = "0.5.1";
15   format = "setuptools";
17   src = fetchPypi {
18     inherit pname version;
19     sha256 = "fb4195aaabfc01586863f60d3190b5cb1bf8f12622fd597e23e48768dad6bde8";
20   };
22   patches = [
23     # https://github.com/bivab/smbus-cffi/pull/24
24     (fetchpatch {
25       url = "https://github.com/bivab/smbus-cffi/commit/ba79ae174a9d84e767d95f165c43ee212b1bbb92.patch";
26       hash = "sha256-WtRuK5y6fWDEhm0Xy5XqS5yCkn7vXXYtjlOjS90gla4=";
27     })
28   ];
30   propagatedNativeBuildInputs = [ cffi ];
32   propagatedBuildInputs = [ cffi ];
34   installCheckPhase = ''
35     # we want to import the installed module that also contains the compiled library
36     rm -rf smbus
37     runHook pytestCheckPhase
38   '';
40   # requires hardware access
41   pytestFlagsArray = [ "--ignore=test/test_smbus_integration.py" ];
43   nativeCheckInputs = [
44     py
45     pytestCheckHook
46     pyserial
47   ];
49   meta = with lib; {
50     description = "Python module for SMBus access through Linux I2C /dev interface";
51     homepage = "https://github.com/bivab/smbus-cffi";
52     license = licenses.gpl2;
53     maintainers = with maintainers; [ mic92 ];
54     platforms = platforms.linux;
55   };