summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/markdown-inline-graphviz/default.nix
blob: cf07c9249c83f581edf5ae0ff43a249206e83710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
{
  buildPythonPackage,
  fetchFromGitHub,
  pkgs, # Only for pkgs.graphviz
  lib,
  setuptools,
  markdown,
}:

buildPythonPackage rec {
  pname = "markdown-inline-graphviz";
  version = "1.1.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "cesaremorel";
    repo = "markdown-inline-graphviz";
    tag = "v${version}";
    hash = "sha256-FUBRFImX5NOxyYAK7z5Bo8VKVQllTbEewEGZXtVMBQE=";
  };

  # Using substituteInPlace because there's only one replacement
  postPatch = ''
    substituteInPlace markdown_inline_graphviz.py \
      --replace-fail "args = [command, '-T'+filetype]" "args = [\"${pkgs.graphviz}/bin/\" + command, '-T'+filetype]"
  '';

  build-system = [ setuptools ];

  dependencies = [ markdown ];

  # No tests available
  doCheck = false;

  pythonImportsCheck = [ "markdown_inline_graphviz" ];

  meta = {
    description = "Render inline graphs with Markdown and Graphviz";
    homepage = "https://github.com/cesaremorel/markdown-inline-graphviz/";
    changelog = "https://github.com/cesaremorel/markdown-inline-graphviz/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
}