1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, graphviz
5, stdlib-list
6, pytestCheckHook
7, pythonOlder
8, pyyaml
9, toml
10}:
11
12buildPythonPackage rec {
13 pname = "pydeps";
14 version = "1.12.17";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.7";
18
19 src = fetchFromGitHub {
20 owner = "thebjorn";
21 repo = pname;
22 rev = "refs/tags/v${version}";
23 hash = "sha256-DVSZeNuDz/y0jh/HimV+jFgNFevMhUKOu6EhZytMMqQ=";
24 };
25
26 buildInputs = [
27 graphviz
28 ];
29
30 propagatedBuildInputs = [
31 graphviz
32 stdlib-list
33 ];
34
35 nativeCheckInputs = [
36 pytestCheckHook
37 pyyaml
38 toml
39 ];
40
41 postPatch = ''
42 # Path is hard-coded
43 substituteInPlace pydeps/dot.py \
44 --replace "dot -Gstart=1" "${lib.makeBinPath [ graphviz ]}/dot -Gstart=1"
45 '';
46
47 disabledTests = [
48 # Would require to have additional modules available
49 "test_find_package_names"
50 ];
51
52 pythonImportsCheck = [
53 "pydeps"
54 ];
55
56 meta = with lib; {
57 description = "Python module dependency visualization";
58 homepage = "https://github.com/thebjorn/pydeps";
59 changelog = "https://github.com/thebjorn/pydeps/releases/tag/v${version}";
60 license = licenses.bsd2;
61 maintainers = with maintainers; [ fab ];
62 };
63}