2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3Packages
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "refurb";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "1.27.0";
|
2022-12-17 10:02:37 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dosisod";
|
|
|
|
repo = "refurb";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-v9zeip7dyEGbn4FVXkd713ybVyf9tvvflCeiS4H7lO0=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postPatch = ''
|
|
|
|
# remove --cov* options provided to pytest
|
|
|
|
sed -i '/^addopts = "--cov/d' pyproject.toml
|
|
|
|
'';
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
nativeBuildInputs = with python3Packages; [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
|
|
|
mypy
|
|
|
|
mypy-extensions
|
|
|
|
tomli
|
|
|
|
typing-extensions
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = with python3Packages; [
|
2022-12-17 10:02:37 +00:00
|
|
|
attrs
|
|
|
|
click
|
|
|
|
colorama
|
|
|
|
iniconfig
|
|
|
|
mccabe
|
|
|
|
packaging
|
|
|
|
pathspec
|
|
|
|
platformdirs
|
|
|
|
pluggy
|
|
|
|
py
|
|
|
|
pyparsing
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_checks" # broken because new mypy release added new checks
|
|
|
|
];
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"refurb"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A tool for refurbishing and modernizing Python codebases";
|
|
|
|
homepage = "https://github.com/dosisod/refurb";
|
|
|
|
license = with licenses; [ gpl3Only ];
|
|
|
|
maintainers = with maintainers; [ knl ];
|
|
|
|
};
|
|
|
|
}
|