nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 graphviz,
6 imagemagick,
7 inkscape,
8 jinja2,
9 hatchling,
10 pytestCheckHook,
11 round,
12}:
13
14buildPythonPackage rec {
15 pname = "diagrams";
16 version = "0.25.1";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "mingrammer";
21 repo = "diagrams";
22 tag = "v${version}";
23 hash = "sha256-uDBmQSEn9LMT2CbR3VDhxW1ec4udXN5wZ1H1+RX/K0U=";
24 };
25
26 patches = [
27 ./remove-black-requirement.patch
28 ];
29
30 pythonRemoveDeps = [ "pre-commit" ];
31
32 pythonRelaxDeps = [ "graphviz" ];
33
34 preConfigure = ''
35 patchShebangs autogen.sh
36 ./autogen.sh
37 '';
38
39 build-system = [ hatchling ];
40
41 # Despite living in 'tool.poetry.dependencies',
42 # these are only used at build time to process the image resource files
43 nativeBuildInputs = [
44 inkscape
45 imagemagick
46 jinja2
47 round
48 ];
49
50 dependencies = [ graphviz ];
51
52 nativeCheckInputs = [ pytestCheckHook ];
53
54 pythonImportsCheck = [ "diagrams" ];
55
56 meta = {
57 description = "Diagram as Code";
58 homepage = "https://diagrams.mingrammer.com/";
59 changelog = "https://github.com/mingrammer/diagrams/releases/tag/${src.tag}";
60 license = lib.licenses.mit;
61 maintainers = with lib.maintainers; [ addict3d ];
62 };
63}