nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, buildPythonPackage, fetchFromGitHub
2, colorama
3, hypothesis
4, poetry-core
5, pylama
6, pytestCheckHook
7}:
8
9buildPythonPackage rec {
10 pname = "isort";
11 version = "5.10.1";
12 format = "pyproject";
13
14 src = fetchFromGitHub {
15 owner = "PyCQA";
16 repo = "isort";
17 rev = version;
18 sha256 = "09spgl2k9xrprr5gbpfc91a8p7mx7a0c64ydgc91b3jhrmnd9jg1";
19 };
20
21 nativeBuildInputs = [
22 poetry-core
23 ];
24
25 checkInputs = [
26 colorama
27 hypothesis
28 pylama
29 pytestCheckHook
30 ];
31
32 postCheck = ''
33 # Confirm that the produced executable script is wrapped correctly and runs
34 # OK, by launching it in a subshell without PYTHONPATH
35 (
36 unset PYTHONPATH
37 echo "Testing that `isort --version-number` returns OK..."
38 $out/bin/isort --version-number
39 )
40 '';
41
42 preCheck = ''
43 HOME=$TMPDIR
44 export PATH=$PATH:$out/bin
45 '';
46
47 pytestFlagsArray = [
48 "--ignore=tests/benchmark/" # requires pytest-benchmark
49 "--ignore=tests/integration/" # pulls in 10 other packages
50 "--ignore=tests/unit/profiles/test_black.py" # causes infinite recursion to include black
51 ];
52
53 disabledTests = [
54 "test_run" # doesn't like paths in /build
55 "test_fuzz_show_unified_diff" # flakey
56 "test_pyi_formatting_issue_942"
57 "test_requirements_finder"
58 "test_pipfile_finder"
59 "test_main" # relies on git
60 "test_command_line" # not thread safe
61 "test_encoding_not_in_comment" # not python 3.9 compatible
62 "test_encoding_not_in_first_two_lines" # not python 3.9 compatible
63 "test_requirements_dir" # requires network
64 # plugin not available
65 "test_isort_literals_issue_1358"
66 "test_isort_supports_formatting_plugins_issue_1353"
67 "test_sort_configurable_sort_issue_1732"
68 "test_value_assignment_list"
69 # profiles not available
70 "test_isort_supports_shared_profiles_issue_970"
71 ];
72
73 meta = with lib; {
74 description = "A Python utility / library to sort Python imports";
75 homepage = "https://github.com/PyCQA/isort";
76 license = licenses.mit;
77 maintainers = with maintainers; [ couchemar ];
78 };
79}