2019-03-05 13:55:42 +00:00
|
|
|
{ lib, buildPythonPackage, fetchPypi, isPy27, futures, backports_functools_lru_cache, mock, pytest }:
|
2018-03-07 14:19:37 +00:00
|
|
|
|
2019-03-05 13:55:42 +00:00
|
|
|
let
|
2019-06-15 07:09:25 +00:00
|
|
|
skipTests = [ "test_requirements_finder" "test_pipfile_finder" ] ++ lib.optional isPy27 "test_standard_library_deprecates_user_issue_778";
|
2019-03-05 13:55:42 +00:00
|
|
|
testOpts = lib.concatMapStringsSep " " (t: "--deselect test_isort.py::${t}") skipTests;
|
|
|
|
in buildPythonPackage rec {
|
2018-03-07 14:19:37 +00:00
|
|
|
pname = "isort";
|
2019-05-30 06:49:51 +00:00
|
|
|
version = "4.3.20"; # Note 4.x is the last version that supports Python2
|
2018-03-07 14:19:37 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2019-05-30 06:49:51 +00:00
|
|
|
sha256 = "c40744b6bc5162bbb39c1257fe298b7a393861d50978b565f3ccd9cb9de0182a";
|
2018-03-07 14:19:37 +00:00
|
|
|
};
|
|
|
|
|
2019-03-05 13:55:42 +00:00
|
|
|
propagatedBuildInputs = lib.optionals isPy27 [ futures backports_functools_lru_cache ];
|
2018-03-07 14:19:37 +00:00
|
|
|
|
|
|
|
checkInputs = [ mock pytest ];
|
|
|
|
|
2019-03-05 13:55:42 +00:00
|
|
|
# isort excludes paths that contain /build/, so test fixtures don't work with TMPDIR=/build/
|
2018-03-07 14:19:37 +00:00
|
|
|
checkPhase = ''
|
2019-03-05 13:55:42 +00:00
|
|
|
PATH=$out/bin:$PATH TMPDIR=/tmp/ pytest ${testOpts}
|
2018-03-07 14:19:37 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A Python utility / library to sort Python imports";
|
|
|
|
homepage = https://github.com/timothycrosley/isort;
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ couchemar nand0p ];
|
|
|
|
};
|
|
|
|
}
|