depot/third_party/nixpkgs/pkgs/development/python-modules/pyudev/default.nix
Default email 5083ee08a2 Project import generated by Copybara.
GitOrigin-RevId: 10ecda252ce1b3b1d6403caeadbcc8f30d5ab796
2022-09-30 06:47:45 -05:00

35 lines
811 B
Nix

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