1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pytestCheckHook,
6 fetchpatch,
7 # Python deps
8 mando,
9 colorama,
10 pytest-mock,
11 tomli,
12 poetry-core,
13}:
14
15buildPythonPackage rec {
16 pname = "radon";
17 version = "6.0.1";
18
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "rubik";
23 repo = "radon";
24 rev = "v${version}";
25 hash = "sha256-yY+j9kuX0ou/uDoVI/Qfqsmq0vNHv735k+vRl22LwwY=";
26 };
27
28 patches = [
29 # NOTE: Remove after next release
30 (fetchpatch {
31 url = "https://github.com/rubik/radon/commit/ce5d2daa0a9e0e843059d6f57a8124c64a87a6dc.patch";
32 hash = "sha256-WwcfR2ZEWeRiMKdMZAwtZRBcWOqoqpaVTmVo0k+Tn74=";
33 })
34 ];
35
36 nativeBuildInputs = [ poetry-core ];
37
38 nativeCheckInputs = [
39 pytestCheckHook
40 pytest-mock
41 ];
42
43 propagatedBuildInputs = [
44 mando
45 colorama
46 ];
47
48 pythonRelaxDeps = [
49 "mando"
50 ];
51
52 optional-dependencies = {
53 toml = [ tomli ];
54 };
55
56 pythonImportsCheck = [ "radon" ];
57
58 meta = with lib; {
59 description = "Various code metrics for Python code";
60 homepage = "https://radon.readthedocs.org";
61 changelog = "https://github.com/rubik/radon/blob/v${version}/CHANGELOG";
62 license = licenses.mit;
63 maintainers = with maintainers; [ t4ccer ];
64 mainProgram = "radon";
65 };
66}