1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, diff-cover
6, graphviz
7, hatchling
8, hatch-vcs
9, pytest-mock
10, pytestCheckHook
11, pip
12, virtualenv
13}:
14
15buildPythonPackage rec {
16 pname = "pipdeptree";
17 version = "2.3.3";
18 format = "pyproject";
19
20 disabled = pythonOlder "3.7";
21
22 src = fetchFromGitHub {
23 owner = "tox-dev";
24 repo = "pipdeptree";
25 rev = "refs/tags/${version}";
26 hash = "sha256-ivqu9b+4FhGa5y+WnKRk4nF6MR4Vj62pSs2d7ycIZMc=";
27 };
28
29 SETUPTOOLS_SCM_PRETEND_VERSION = version;
30
31 nativeBuildInputs = [
32 hatchling
33 hatch-vcs
34 ];
35
36 propagatedBuildInput = [
37 pip
38 ];
39
40 passthru.optional-dependencies = {
41 graphviz = [
42 graphviz
43 ];
44 };
45
46 checkInputs = [
47 diff-cover
48 pytest-mock
49 pytestCheckHook
50 virtualenv
51 ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
52
53 pythonImportsCheck = [
54 "pipdeptree"
55 ];
56
57 meta = with lib; {
58 description = "Command line utility to show dependency tree of packages";
59 homepage = "https://github.com/tox-dev/pipdeptree";
60 changelog = "https://github.com/tox-dev/pipdeptree/releases/tag/${version}";
61 license = licenses.mit;
62 maintainers = with maintainers; [ charlesbaynham ];
63 };
64}