1{ 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, 14}: 15 16buildPythonPackage rec { 17 pname = "diagrams"; 18 version = "0.23.4"; 19 format = "pyproject"; 20 21 disabled = pythonOlder "3.7"; 22 23 src = fetchFromGitHub { 24 owner = "mingrammer"; 25 repo = pname; 26 rev = "refs/tags/v${version}"; 27 hash = "sha256-2jRWN2glGEr51fzny8nkqa5c2EdJG5aZPG2eTD7AISY="; 28 }; 29 30 postPatch = '' 31 substituteInPlace pyproject.toml \ 32 --replace 'graphviz = ">=0.13.2,<0.20.0"' 'graphviz = "*"' 33 ''; 34 35 preConfigure = '' 36 patchShebangs autogen.sh 37 ./autogen.sh 38 ''; 39 40 patches = [ 41 # The build-system section is missing 42 ./build_poetry.patch 43 ./remove-black-requirement.patch 44 ]; 45 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 ]; 55 56 propagatedBuildInputs = [ 57 graphviz 58 typed-ast 59 ]; 60 61 nativeCheckInputs = [ pytestCheckHook ]; 62 63 pythonImportsCheck = [ "diagrams" ]; 64 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 }; 72}