about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pywbem/default.nix
blob: b728d4f6b9435ef5ae9b30c677e12a9f485f655d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{ stdenv, buildPythonPackage, fetchFromGitHub, libxml2
, m2crypto, ply, pyyaml, six
, httpretty, lxml, mock, pytest, requests
}:

buildPythonPackage rec {
  name  = "pywbem-${version}";
  version = "0.10.0";

  src = fetchFromGitHub {
    owner  = "pywbem";
    repo   = "pywbem";
    rev    = "v${version}";
    sha256 = "0jcwklip03xcni0dvsk9va8ilqz21g4fxwqd5kzvv91slaadfcym";
  };

  propagatedBuildInputs = [ m2crypto ply pyyaml six ];

  checkInputs = [ httpretty lxml mock pytest requests ];

  # 1 test fails because it doesn't like running in our sandbox. Deleting the
  # whole file is admittedly a little heavy-handed but at least the vast
  # majority of tests are run.
  checkPhase = ''
    rm testsuite/testclient/networkerror.yaml

    substituteInPlace makefile \
      --replace "PYTHONPATH=." "" \
      --replace '--cov $(package_name) --cov-config coveragerc' ""

    for f in testsuite/test_cim_xml.py testsuite/validate.py ; do
      substituteInPlace $f --replace "'xmllint" "'${stdenv.lib.getBin libxml2}/bin/xmllint"
    done

    make PATH=$PATH:${stdenv.lib.getBin libxml2}/bin test
  '';

  meta = with stdenv.lib; {
    description = "Support for the WBEM standard for systems management.";
    homepage = http://pywbem.github.io/pywbem/;
    license = licenses.gpl2;
    maintainers = with maintainers; [ peterhoeg ];
  };
}