From 915d58ba7cbb763bb6b6574c74a54fceca53128f Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Mon, 30 Mar 2020 14:57:50 -0700 Subject: [PATCH] python3Packages.subunit: fix build and add tests --- .../python-modules/subunit/default.nix | 33 ++++++++++++------- pkgs/top-level/python-packages.nix | 4 ++- 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/subunit/default.nix b/pkgs/development/python-modules/subunit/default.nix index eeef94e6c76..f4622689187 100644 --- a/pkgs/development/python-modules/subunit/default.nix +++ b/pkgs/development/python-modules/subunit/default.nix @@ -1,22 +1,33 @@ { buildPythonPackage -, pkgs -, testtools +# pkgs dependencies +, check +, cppunit +, pkg-config +, subunit + +# python dependencies +, fixtures +, hypothesis +, pytest , testscenarios +, testtools }: buildPythonPackage { - name = pkgs.subunit.name; - src = pkgs.subunit.src; + inherit (subunit) name src meta; + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ check cppunit ]; propagatedBuildInputs = [ testtools ]; - checkInputs = [ testscenarios ]; - nativeBuildInputs = [ pkgs.pkgconfig ]; - buildInputs = [ pkgs.check pkgs.cppunit ]; - patchPhase = '' - sed -i 's/version=VERSION/version="${pkgs.subunit.version}"/' setup.py + checkInputs = [ testscenarios hypothesis fixtures pytest ]; + # ignore tests which call shell code, or call methods which haven't been implemented + checkPhase = '' + pytest python/subunit \ + --ignore=python/subunit/tests/test_{output_filter,test_protocol{,2}}.py ''; - meta = pkgs.subunit.meta; - + patchPhase = '' + sed -i 's/version=VERSION/version="${subunit.version}"/' setup.py + ''; } diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 74003cde6e5..ef46edc70b4 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6158,7 +6158,9 @@ in { subdownloader = callPackage ../development/python-modules/subdownloader { }; - subunit = callPackage ../development/python-modules/subunit { }; + subunit = callPackage ../development/python-modules/subunit { + inherit (pkgs) subunit pkg-config cppunit check; + }; sure = callPackage ../development/python-modules/sure { };