anki-bin: 24.06.3 -> 24.11 (#360722)
[NixPkgs.git] / pkgs / development / python-modules / diagrams / default.nix
blob85eafa12893b6825f84e2afb80a2ddfb0156060b
2   lib,
3   buildPythonPackage,
4   pythonOlder,
5   fetchFromGitHub,
6   jinja2,
7   poetry-core,
8   round,
9   graphviz,
10   inkscape,
11   imagemagick,
12   pytestCheckHook,
13   typed-ast,
16 buildPythonPackage rec {
17   pname = "diagrams";
18   version = "0.23.4";
19   format = "pyproject";
21   disabled = pythonOlder "3.7";
23   src = fetchFromGitHub {
24     owner = "mingrammer";
25     repo = pname;
26     rev = "refs/tags/v${version}";
27     hash = "sha256-2jRWN2glGEr51fzny8nkqa5c2EdJG5aZPG2eTD7AISY=";
28   };
30   postPatch = ''
31     substituteInPlace pyproject.toml \
32       --replace 'graphviz = ">=0.13.2,<0.20.0"' 'graphviz = "*"'
33   '';
35   preConfigure = ''
36     patchShebangs autogen.sh
37     ./autogen.sh
38   '';
40   patches = [
41     # The build-system section is missing
42     ./build_poetry.patch
43     ./remove-black-requirement.patch
44   ];
46   # Despite living in 'tool.poetry.dependencies',
47   # these are only used at build time to process the image resource files
48   nativeBuildInputs = [
49     inkscape
50     imagemagick
51     jinja2
52     poetry-core
53     round
54   ];
56   propagatedBuildInputs = [
57     graphviz
58     typed-ast
59   ];
61   nativeCheckInputs = [ pytestCheckHook ];
63   pythonImportsCheck = [ "diagrams" ];
65   meta = with lib; {
66     description = "Diagram as Code";
67     homepage = "https://diagrams.mingrammer.com/";
68     changelog = "https://github.com/mingrammer/diagrams/releases/tag/v${version}";
69     license = licenses.mit;
70     maintainers = with maintainers; [ addict3d ];
71   };