diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-09 18:55:19 +0000 |
commit | 80d90d9b204f7c17912740f9f414fe5d59f293ba (patch) | |
tree | 5f2065a06e724270610760d59d01c6888b375a46 /infra/libkookie/nixpkgs/pkgs/development/python-modules/isort/4.nix | |
parent | 3a31a84c7d3e589035ad08499206aac44a81f424 (diff) | |
parent | 83cbad92d73216bb0d9187c56cce0b91f9121d5a (diff) |
Merge commit '83cbad92d73216bb0d9187c56cce0b91f9121d5a' into main
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/python-modules/isort/4.nix')
-rw-r--r-- | infra/libkookie/nixpkgs/pkgs/development/python-modules/isort/4.nix | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/python-modules/isort/4.nix b/infra/libkookie/nixpkgs/pkgs/development/python-modules/isort/4.nix new file mode 100644 index 000000000000..b2ef4e66f361 --- /dev/null +++ b/infra/libkookie/nixpkgs/pkgs/development/python-modules/isort/4.nix @@ -0,0 +1,43 @@ +{ 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"; + testOpts = lib.concatMapStringsSep " " (t: "--deselect test_isort.py::${t}") skipTests; +in buildPythonPackage rec { + pname = "isort"; + version = "4.3.21"; # Note 4.x is the last version that supports Python2 + + src = fetchPypi { + inherit pname version; + sha256 = "54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1"; + }; + + propagatedBuildInputs = [ + setuptools + ] ++ lib.optionals isPy27 [ futures backports_functools_lru_cache ]; + + checkInputs = [ mock pytest ]; + + 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; { + description = "A Python utility / library to sort Python imports"; + homepage = "https://github.com/timothycrosley/isort"; + license = licenses.mit; + maintainers = with maintainers; [ couchemar nand0p ]; + }; +} |