depot/third_party/nixpkgs/pkgs/development/python-modules/pyudev/default.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

51 lines
995 B
Nix

{
lib,
fetchPypi,
buildPythonPackage,
six,
udev,
pytest,
mock,
hypothesis,
docutils,
stdenvNoCC,
}:
buildPythonPackage rec {
pname = "pyudev";
version = "0.24.3";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-LpRUJ6IWdIk7uXYyQB22ITnZHOoe6WE3zHsHrSIZj8c=";
};
postPatch = lib.optionalString stdenvNoCC.hostPlatform.isLinux ''
substituteInPlace src/pyudev/_ctypeslib/utils.py \
--replace "find_library(name)" "'${lib.getLib udev}/lib/libudev.so'"
'';
nativeCheckInputs = [
pytest
mock
hypothesis
docutils
];
propagatedBuildInputs = [ six ];
checkPhase = ''
py.test
'';
# Bunch of failing tests
# https://github.com/pyudev/pyudev/issues/187
doCheck = false;
meta = with lib; {
homepage = "https://pyudev.readthedocs.org/";
description = "Pure Python libudev binding";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ frogamic ];
};
}