nixpkgs/pkgs/development/tools/refurb/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
1.2 KiB
Nix
Raw Normal View History

2022-09-28 10:10:20 +00:00
{ lib
, fetchFromGitHub
, python3Packages
}:
python3Packages.buildPythonApplication rec {
pname = "refurb";
2024-01-27 19:12:18 +00:00
version = "1.28.0";
2022-09-28 10:10:20 +00:00
format = "pyproject";
src = fetchFromGitHub {
owner = "dosisod";
repo = "refurb";
2022-12-06 18:01:21 +00:00
rev = "refs/tags/v${version}";
2024-01-27 19:12:18 +00:00
hash = "sha256-b7Id2Oyjw3NZno56IMDIq7fn5u9+jn42nuae8ix90fM=";
2022-09-28 10:10:20 +00:00
};
2023-06-15 14:32:28 +00:00
postPatch = ''
# remove --cov* options provided to pytest
sed -i '/^addopts = "--cov/d' pyproject.toml
'';
2022-09-28 10:10:20 +00:00
nativeBuildInputs = with python3Packages; [
poetry-core
];
propagatedBuildInputs = with python3Packages; [
mypy
mypy-extensions
tomli
typing-extensions
];
nativeCheckInputs = with python3Packages; [
2022-09-28 10:10:20 +00:00
attrs
click
colorama
iniconfig
mccabe
packaging
pathspec
platformdirs
pluggy
py
pyparsing
pytestCheckHook
];
2023-06-15 14:32:28 +00:00
disabledTests = [
"test_checks" # broken because new mypy release added new checks
];
2022-09-28 10:10:20 +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 ];
};
}