2021-12-26 17:43:05 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, substituteAll
|
|
|
|
, git
|
|
|
|
, eradicate
|
|
|
|
, mccabe
|
|
|
|
, mypy
|
|
|
|
, pycodestyle
|
|
|
|
, pydocstyle
|
|
|
|
, pyflakes
|
|
|
|
, vulture
|
2022-09-30 11:47:45 +00:00
|
|
|
, setuptools
|
2022-04-15 01:41:22 +00:00
|
|
|
, isort
|
|
|
|
, pylint
|
2021-12-26 17:43:05 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
let pylama = buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "pylama";
|
2022-08-21 13:32:41 +00:00
|
|
|
version = "8.4.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-12-30 13:39:12 +00:00
|
|
|
name = "${pname}-${version}-source";
|
2021-12-26 17:43:05 +00:00
|
|
|
owner = "klen";
|
|
|
|
repo = "pylama";
|
|
|
|
rev = version;
|
2022-08-21 13:32:41 +00:00
|
|
|
hash = "sha256-WOGtZ412tX3YH42JCd5HIngunluwtMmQrOSUZp23LPU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./paths.patch;
|
|
|
|
git = "${lib.getBin git}/bin/git";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
eradicate
|
|
|
|
mccabe
|
2021-12-26 17:43:05 +00:00
|
|
|
mypy
|
2020-04-24 23:36:52 +00:00
|
|
|
pycodestyle
|
|
|
|
pydocstyle
|
|
|
|
pyflakes
|
2022-09-30 11:47:45 +00:00
|
|
|
setuptools
|
2021-12-26 17:43:05 +00:00
|
|
|
vulture
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
# escape infinite recursion pylint -> isort -> pylama
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
checkInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
pylint
|
2021-12-26 17:43:05 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TEMP
|
|
|
|
'';
|
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_quotes" # FIXME package pylama-quotes
|
|
|
|
"test_radon" # FIXME package radon
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"pylama.main"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
passthru.tests = {
|
|
|
|
check = pylama.overridePythonAttrs (_: { doCheck = true; });
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Code audit tool for python";
|
|
|
|
homepage = "https://github.com/klen/pylama";
|
2022-04-27 09:35:20 +00:00
|
|
|
changelog = "https://github.com/klen/pylama/blob/${version}/Changelog";
|
2021-12-26 17:43:05 +00:00
|
|
|
license = licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
2022-08-12 12:06:08 +00:00
|
|
|
}; in pylama
|