about summary refs log tree commit diff
path: root/pkgs/development/python-modules/radon/default.nix
blob: 5d494b4c2996b566f712c7e9d7a734f5213e6c5f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  fetchpatch,
  # Python deps
  mando,
  colorama,
  pytest-mock,
  tomli,
  poetry-core,
}:

buildPythonPackage rec {
  pname = "radon";
  version = "6.0.1";

  pyproject = true;

  src = fetchFromGitHub {
    owner = "rubik";
    repo = "radon";
    rev = "v${version}";
    hash = "sha256-yY+j9kuX0ou/uDoVI/Qfqsmq0vNHv735k+vRl22LwwY=";
  };

  patches = [
    # NOTE: Remove after next release
    (fetchpatch {
      url = "https://github.com/rubik/radon/commit/ce5d2daa0a9e0e843059d6f57a8124c64a87a6dc.patch";
      hash = "sha256-WwcfR2ZEWeRiMKdMZAwtZRBcWOqoqpaVTmVo0k+Tn74=";
    })
  ];

  nativeBuildInputs = [ poetry-core ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-mock
  ];

  propagatedBuildInputs = [
    mando
    colorama
  ];

  passthru.optional-dependencies = {
    toml = [ tomli ];
  };

  pythonImportsCheck = [ "radon" ];

  meta = with lib; {
    description = "Various code metrics for Python code";
    homepage = "https://radon.readthedocs.org";
    changelog = "https://github.com/rubik/radon/blob/v${version}/CHANGELOG";
    license = licenses.mit;
    maintainers = with maintainers; [ t4ccer ];
    mainProgram = "radon";
  };
}