1{ lib 2, buildPythonPackage 3, pythonOlder 4, fetchFromGitHub 5, black 6, jinja2 7, poetry-core 8, round 9, graphviz 10, inkscape 11, imagemagick 12, pytestCheckHook 13}: 14 15buildPythonPackage rec { 16 pname = "diagrams"; 17 version = "0.20.0"; 18 format = "pyproject"; 19 disabled = pythonOlder "3.6"; 20 21 src = fetchFromGitHub { 22 owner = "mingrammer"; 23 repo = pname; 24 rev = "v${version}"; 25 sha256 = "1lcqsy3bvlnlnakjysp8qjhy26bhkp1izi5dvzq2fpsffgxk4si4"; 26 }; 27 28 postPatch = '' 29 substituteInPlace pyproject.toml \ 30 --replace 'jinja2 = "^2.10"' 'jinja2 = "*"' \ 31 --replace 'graphviz = ">=0.13.2,<0.17.0"' 'graphviz = "*"' 32 ''; 33 34 preConfigure = '' 35 patchShebangs autogen.sh 36 ./autogen.sh 37 ''; 38 39 patches = [ 40 # The build-system section is missing 41 ./build_poetry.patch 42 ]; 43 44 checkInputs = [ pytestCheckHook ]; 45 46 # Despite living in 'tool.poetry.dependencies', 47 # these are only used at build time to process the image resource files 48 nativeBuildInputs = [ black inkscape imagemagick jinja2 poetry-core round ]; 49 50 propagatedBuildInputs = [ graphviz ]; 51 52 pythonImportsCheck = [ "diagrams" ]; 53 54 meta = with lib; { 55 description = "Diagram as Code"; 56 homepage = "https://diagrams.mingrammer.com/"; 57 license = licenses.mit; 58 maintainers = with maintainers; [ addict3d ]; 59 }; 60}