ch9344: 2.0 -> 0-unstable-2024-11-15 (#354536)
[NixPkgs.git] / pkgs / development / python-modules / pyudev / default.nix
blobf7b75f0ff22e6946a9a10b52923382d29a732a23
2   lib,
3   fetchPypi,
4   buildPythonPackage,
5   six,
6   udev,
7   pytest,
8   mock,
9   hypothesis,
10   docutils,
11   stdenvNoCC,
14 buildPythonPackage rec {
15   pname = "pyudev";
16   version = "0.24.3";
17   format = "setuptools";
19   src = fetchPypi {
20     inherit pname version;
21     hash = "sha256-LpRUJ6IWdIk7uXYyQB22ITnZHOoe6WE3zHsHrSIZj8c=";
22   };
24   postPatch = lib.optionalString stdenvNoCC.hostPlatform.isLinux ''
25     substituteInPlace src/pyudev/_ctypeslib/utils.py \
26       --replace "find_library(name)" "'${lib.getLib udev}/lib/libudev.so'"
27   '';
29   nativeCheckInputs = [
30     pytest
31     mock
32     hypothesis
33     docutils
34   ];
35   propagatedBuildInputs = [ six ];
37   checkPhase = ''
38     py.test
39   '';
41   # Bunch of failing tests
42   # https://github.com/pyudev/pyudev/issues/187
43   doCheck = false;
45   meta = with lib; {
46     homepage = "https://pyudev.readthedocs.org/";
47     description = "Pure Python libudev binding";
48     license = licenses.lgpl21Plus;
49     maintainers = with maintainers; [ frogamic ];
50   };