nixpkgs-suyu/pkgs/development/tools/refurb/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

64 lines
1.2 KiB
Nix

{ lib
, fetchFromGitHub
, python3Packages
}:
python3Packages.buildPythonApplication rec {
pname = "refurb";
version = "1.28.0";
format = "pyproject";
src = fetchFromGitHub {
owner = "dosisod";
repo = "refurb";
rev = "refs/tags/v${version}";
hash = "sha256-b7Id2Oyjw3NZno56IMDIq7fn5u9+jn42nuae8ix90fM=";
};
postPatch = ''
# remove --cov* options provided to pytest
sed -i '/^addopts = "--cov/d' pyproject.toml
'';
nativeBuildInputs = with python3Packages; [
poetry-core
];
propagatedBuildInputs = with python3Packages; [
mypy
mypy-extensions
tomli
typing-extensions
];
nativeCheckInputs = with python3Packages; [
attrs
click
colorama
iniconfig
mccabe
packaging
pathspec
platformdirs
pluggy
py
pyparsing
pytestCheckHook
];
disabledTests = [
"test_checks" # broken because new mypy release added new checks
];
pythonImportsCheck = [
"refurb"
];
meta = with lib; {
description = "A tool for refurbishing and modernizing Python codebases";
mainProgram = "refurb";
homepage = "https://github.com/dosisod/refurb";
license = with licenses; [ gpl3Only ];
maintainers = with maintainers; [ knl ];
};
}