about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pydeps/default.nix
blob: 23f9353ac9ca5bc349456299c56def407822f346 (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
63
64
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  graphviz,
  stdlib-list,
  pytestCheckHook,
  pythonOlder,
  pyyaml,
  setuptools,
  toml,
}:

buildPythonPackage rec {
  pname = "pydeps";
  version = "1.12.20";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "thebjorn";
    repo = "pydeps";
    rev = "refs/tags/v${version}";
    hash = "sha256-d6EeeNem+HfuipKF5ZOI48c11j0ozGrBP4XlqTx+fJ4=";
  };

  nativeBuildInputs = [ setuptools ];

  buildInputs = [ graphviz ];

  propagatedBuildInputs = [
    graphviz
    stdlib-list
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pyyaml
    toml
  ];

  postPatch = ''
    # Path is hard-coded
    substituteInPlace pydeps/dot.py \
      --replace "dot -Gstart=1" "${lib.makeBinPath [ graphviz ]}/dot -Gstart=1"
  '';

  disabledTests = [
    # Would require to have additional modules available
    "test_find_package_names"
  ];

  pythonImportsCheck = [ "pydeps" ];

  meta = with lib; {
    description = "Python module dependency visualization";
    mainProgram = "pydeps";
    homepage = "https://github.com/thebjorn/pydeps";
    changelog = "https://github.com/thebjorn/pydeps/releases/tag/v${version}";
    license = licenses.bsd2;
    maintainers = with maintainers; [ fab ];
  };
}