1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 graphviz,
6 stdlib-list,
7 pytestCheckHook,
8 pythonOlder,
9 pyyaml,
10 setuptools,
11 toml,
12}:
13
14buildPythonPackage rec {
15 pname = "pydeps";
16 version = "3.0.1";
17 pyproject = true;
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "thebjorn";
23 repo = "pydeps";
24 tag = "v${version}";
25 hash = "sha256-N/WTamT981eQqxhz51Ry2OOPIecnAnYmMHlASmPpFWA=";
26 };
27
28 build-system = [ setuptools ];
29
30 buildInputs = [ graphviz ];
31
32 dependencies = [
33 graphviz
34 stdlib-list
35 ];
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 pyyaml
40 toml
41 ];
42
43 postPatch = ''
44 # Path is hard-coded
45 substituteInPlace pydeps/dot.py \
46 --replace "dot -Gstart=1" "${lib.makeBinPath [ graphviz ]}/dot -Gstart=1"
47 '';
48
49 disabledTests = [
50 # Would require to have additional modules available
51 "test_find_package_names"
52 ];
53
54 pythonImportsCheck = [ "pydeps" ];
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 mainProgram = "pydeps";
63 };
64}