Skip to content

Commit

Permalink
pythonPackages.pyudev: fix package
Browse files Browse the repository at this point in the history
- the function loading the udev library was moved to another file
- the test runner did not work correctly, causing it to fail on Python
3.
- the test runner now works correctly, but there's a bunch of tests
failing and therefore tests are disabled. The package does seem to
function (as in, it can load the library again).
  • Loading branch information
FRidh committed Mar 29, 2017
1 parent b4716ea commit 0784125
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions pkgs/development/python-modules/pyudev.nix
@@ -1,5 +1,5 @@
{ lib, fetchurl, buildPythonPackage
, six, systemd
, six, systemd, pytest, mock, hypothesis, docutils
}:

buildPythonPackage rec {
Expand All @@ -12,12 +12,21 @@ buildPythonPackage rec {
};

postPatch = ''
substituteInPlace src/pyudev/_ctypeslib/libudev.py \
--replace "find_library('udev')" "'${systemd.lib}/lib/libudev.so'"
substituteInPlace src/pyudev/_ctypeslib/utils.py \
--replace "find_library(name)" "'${systemd.lib}/lib/libudev.so'"
'';

buildInputs = [ pytest mock hypothesis docutils ];
propagatedBuildInputs = [ systemd six ];

checkPhase = ''
py.test
'';

# Bunch of failing tests
# https://github.com/pyudev/pyudev/issues/187
doCheck = false;

meta = {
homepage = "http://pyudev.readthedocs.org/";
description = "Pure Python libudev binding";
Expand Down

0 comments on commit 0784125

Please sign in to comment.