From 94a80621ac1d12671593074de88f1ee8012a7f82 Mon Sep 17 00:00:00 2001 From: Alexei Robyn Date: Tue, 29 Oct 2019 11:13:54 +1100 Subject: [PATCH] pythonPackages.isort: Add explicit setuptools dep and bin test --- .../python-modules/isort/default.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/isort/default.nix b/pkgs/development/python-modules/isort/default.nix index 6cc2570ab36a..8e292ba7cd5c 100644 --- a/pkgs/development/python-modules/isort/default.nix +++ b/pkgs/development/python-modules/isort/default.nix @@ -1,4 +1,6 @@ -{ lib, buildPythonPackage, fetchPypi, isPy27, futures, backports_functools_lru_cache, mock, pytest }: +{ lib, buildPythonPackage, fetchPypi, setuptools, isPy27, futures +, backports_functools_lru_cache, mock, pytest +}: let skipTests = [ "test_requirements_finder" "test_pipfile_finder" ] ++ lib.optional isPy27 "test_standard_library_deprecates_user_issue_778"; @@ -12,13 +14,24 @@ in buildPythonPackage rec { sha256 = "54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1"; }; - propagatedBuildInputs = lib.optionals isPy27 [ futures backports_functools_lru_cache ]; + propagatedBuildInputs = [ + setuptools + ] ++ lib.optionals isPy27 [ futures backports_functools_lru_cache ]; checkInputs = [ mock pytest ]; - # isort excludes paths that contain /build/, so test fixtures don't work with TMPDIR=/build/ checkPhase = '' + # isort excludes paths that contain /build/, so test fixtures don't work + # with TMPDIR=/build/ PATH=$out/bin:$PATH TMPDIR=/tmp/ pytest ${testOpts} + + # Confirm that the produced executable script is wrapped correctly and runs + # OK, by launching it in a subshell without PYTHONPATH + ( + unset PYTHONPATH + echo "Testing that `isort --version-number` returns OK..." + $out/bin/isort --version-number + ) ''; meta = with lib; {