2020-11-29 21:17:17 +00:00
|
|
|
{ lib, buildPythonPackage, fetchFromGitHub
|
2020-11-29 21:14:18 +00:00
|
|
|
, colorama
|
2020-11-29 21:17:17 +00:00
|
|
|
, hypothesis
|
2020-11-30 17:40:06 +00:00
|
|
|
, poetry-core
|
2020-11-29 21:17:17 +00:00
|
|
|
, pylama
|
|
|
|
, pytestCheckHook
|
2019-10-29 00:13:54 +00:00
|
|
|
}:
|
2018-03-07 14:19:37 +00:00
|
|
|
|
2019-03-05 13:55:42 +00:00
|
|
|
let
|
|
|
|
in buildPythonPackage rec {
|
2018-03-07 14:19:37 +00:00
|
|
|
pname = "isort";
|
2020-11-29 21:14:18 +00:00
|
|
|
version = "5.6.4";
|
|
|
|
format = "pyproject";
|
2018-03-07 14:19:37 +00:00
|
|
|
|
2020-11-29 21:14:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "PyCQA";
|
|
|
|
repo = "isort";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1m7jpqssnbsn1ydrw1dn7nrcrggqcvj9v6mk5ampxmvk94xd2r2q";
|
2018-03-07 14:19:37 +00:00
|
|
|
};
|
|
|
|
|
2020-11-30 17:40:06 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
2020-11-29 21:14:18 +00:00
|
|
|
];
|
2018-03-07 14:19:37 +00:00
|
|
|
|
2020-11-29 21:17:17 +00:00
|
|
|
checkInputs = [
|
|
|
|
colorama
|
|
|
|
hypothesis
|
|
|
|
pylama
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2019-10-29 00:13:54 +00:00
|
|
|
|
2020-11-29 21:14:18 +00:00
|
|
|
postCheck = ''
|
2019-10-29 00:13:54 +00:00
|
|
|
# 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
|
|
|
|
)
|
2018-03-07 14:19:37 +00:00
|
|
|
'';
|
|
|
|
|
2020-11-29 21:14:18 +00:00
|
|
|
preCheck = ''
|
|
|
|
HOME=$TMPDIR
|
|
|
|
export PATH=$PATH:$out/bin
|
|
|
|
'';
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"--ignore=tests/integration/" # pulls in 10 other packages
|
|
|
|
"--ignore=tests/unit/profiles/test_black.py" # causes infinite recursion to include black
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
"test_run" # doesn't like paths in /build
|
|
|
|
"test_pyi_formatting_issue_942"
|
|
|
|
"test_requirements_finder"
|
|
|
|
"test_pipfile_finder"
|
|
|
|
"test_main" # relies on git
|
|
|
|
"test_command_line" # not thread safe
|
|
|
|
"test_encoding_not_in_comment" # not python 3.9 compatible
|
|
|
|
"test_encoding_not_in_first_two_lines" # not python 3.9 compatible
|
|
|
|
"test_requirements_dir" # requires network
|
|
|
|
# plugin not available
|
|
|
|
"test_isort_literals_issue_1358"
|
|
|
|
"test_isort_supports_formatting_plugins_issue_1353"
|
|
|
|
"test_value_assignment_list"
|
|
|
|
# profiles not available
|
|
|
|
"test_isort_supports_shared_profiles_issue_970"
|
|
|
|
];
|
|
|
|
|
2018-03-07 14:19:37 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A Python utility / library to sort Python imports";
|
2020-11-29 20:28:25 +00:00
|
|
|
homepage = "https://github.com/PyCQA/isort";
|
2018-03-07 14:19:37 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ couchemar nand0p ];
|
|
|
|
};
|
|
|
|
}
|