From 7b6b7f6b78fbb47812eef116b85e58f4c4ceb70a Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 1 Feb 2017 14:26:27 +0100 Subject: [PATCH] Python Flit: run tests by default --- .../python/build-python-package-flit.nix | 13 ++++++++----- .../interpreters/python/build-python-package.nix | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/pkgs/development/interpreters/python/build-python-package-flit.nix b/pkgs/development/interpreters/python/build-python-package-flit.nix index 8628c3df769e..1beff0ebd834 100644 --- a/pkgs/development/interpreters/python/build-python-package-flit.nix +++ b/pkgs/development/interpreters/python/build-python-package-flit.nix @@ -1,6 +1,7 @@ # This function provides specific bits for building a flit-based Python package. -{ flit +{ python +, flit }: { ... } @ attrs: @@ -13,7 +14,9 @@ attrs // { runHook postBuild ''; - # Flit packages do not come with tests. - installCheckPhase = attrs.checkPhase or ":"; - doCheck = attrs.doCheck or false; -} \ No newline at end of file + # Flit packages, like setuptools packages, might have tests. + installCheckPhase = attrs.checkPhase or '' + ${python.interpreter} -m unittest discover + ''; + doCheck = attrs.doCheck or true; +} diff --git a/pkgs/development/interpreters/python/build-python-package.nix b/pkgs/development/interpreters/python/build-python-package.nix index e15405e2981d..b26bf1539cd5 100644 --- a/pkgs/development/interpreters/python/build-python-package.nix +++ b/pkgs/development/interpreters/python/build-python-package.nix @@ -12,7 +12,7 @@ let setuptools-specific = import ./build-python-package-setuptools.nix { inherit lib python bootstrapped-pip; }; - flit-specific = import ./build-python-package-flit.nix { inherit flit; }; + flit-specific = import ./build-python-package-flit.nix { inherit python flit; }; wheel-specific = import ./build-python-package-wheel.nix { }; common = import ./build-python-package-common.nix { inherit python bootstrapped-pip; }; in @@ -34,4 +34,4 @@ let else if format == "other" then {} else throw "Unsupported format ${format}"; -in mkPythonDerivation ( attrs // formatspecific ) \ No newline at end of file +in mkPythonDerivation ( attrs // formatspecific )