pythonPackages.isort: Add explicit setuptools dep and bin test

This commit is contained in:
Alexei Robyn 2019-10-29 11:13:54 +11:00 committed by Jon
parent 753ab3ce84
commit 94a80621ac

View file

@ -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; {