From da8fc391a0897a3897630ce322ad19a825a4ac93 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 13 Apr 2018 12:25:10 -0400 Subject: [PATCH] pythonPackages.buildSetupcfg: Allow disabling tests. --- pkgs/build-support/build-setupcfg/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/build-support/build-setupcfg/default.nix b/pkgs/build-support/build-setupcfg/default.nix index 62dda59f1d5..bc6482f0a88 100644 --- a/pkgs/build-support/build-setupcfg/default.nix +++ b/pkgs/build-support/build-setupcfg/default.nix @@ -5,18 +5,20 @@ # * meta: Standard nixpkgs metadata. # * application: Whether this package is a python library or an # application which happens to be written in python. -pythonPackages: { src, info, meta ? {}, application ? false }: let +# * doCheck: Whether to run the test suites. +pythonPackages: +{ src, info, meta ? {}, application ? false, doCheck ? true }: let build = if application then pythonPackages.buildPythonApplication else pythonPackages.buildPythonPackage; in build { inherit (info) pname version; - inherit src meta; + inherit src meta doCheck; nativeBuildInputs = map (p: pythonPackages.${p}) ( (info.setup_requires or []) ++ - (info.tests_require or [])); + (if doCheck then (info.tests_require or []) else [])); propagatedBuildInputs = map (p: pythonPackages.${p}) (info.install_requires or []);