From b6941c45009b5e02d2de7a89d3319df03d11ecf8 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Mon, 7 Aug 2017 23:23:48 +0800 Subject: [PATCH] pywbem: init at 0.10.0 --- .../python-modules/pywbem/default.nix | 44 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 3 ++ 2 files changed, 47 insertions(+) create mode 100644 pkgs/development/python-modules/pywbem/default.nix diff --git a/pkgs/development/python-modules/pywbem/default.nix b/pkgs/development/python-modules/pywbem/default.nix new file mode 100644 index 000000000000..b728d4f6b943 --- /dev/null +++ b/pkgs/development/python-modules/pywbem/default.nix @@ -0,0 +1,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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5a817b752925..6aca05cf2c56 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -29464,6 +29464,9 @@ EOF }; }; + # We need "normal" libxml2 and not the python package by the same name. + pywbem = callPackage ../development/python-modules/pywbem { libxml2 = pkgs.libxml2; }; + unicorn = buildPythonPackage rec { name = "unicorn-${version}"; version = "1.0.1";