3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/python-modules/isort/default.nix

31 lines
1.1 KiB
Nix
Raw Normal View History

{ lib, buildPythonPackage, fetchPypi, isPy27, futures, backports_functools_lru_cache, mock, pytest }:
2018-03-07 14:19:37 +00:00
let
skipTests = lib.optional isPy27 "test_standard_library_deprecates_user_issue_778";
testOpts = lib.concatMapStringsSep " " (t: "--deselect test_isort.py::${t}") skipTests;
in buildPythonPackage rec {
2018-03-07 14:19:37 +00:00
pname = "isort";
2019-04-16 18:15:36 +01:00
version = "4.3.17"; # Note 4.x is the last version that supports Python2
2018-03-07 14:19:37 +00:00
src = fetchPypi {
inherit pname version;
2019-04-16 18:15:36 +01:00
sha256 = "268067462aed7eb2a1e237fcb287852f22077de3fb07964e87e00f829eea2d1a";
2018-03-07 14:19:37 +00:00
};
propagatedBuildInputs = lib.optionals isPy27 [ futures backports_functools_lru_cache ];
2018-03-07 14:19:37 +00:00
checkInputs = [ mock pytest ];
# isort excludes paths that contain /build/, so test fixtures don't work with TMPDIR=/build/
2018-03-07 14:19:37 +00:00
checkPhase = ''
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 ];
};
}