summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/sphinx-markdown-builder/default.nix
blob: 9238b0c5c38b04c66f3d817295fd226a0497bad9 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  nix-update-script,
  fetchpatch2,

  # build system
  setuptools,
  wheel,

  # deps
  docutils,
  sphinx,
  tabulate,

  # tests
  pytestCheckHook,

  # optional deps
  black,
  bumpver,
  coveralls,
  flake8,
  isort,
  pip-tools,
  pylint,
  pytest,
  pytest-cov,
  sphinxcontrib-httpdomain,
  sphinxcontrib-plantuml,
}:

buildPythonPackage rec {
  pname = "sphinx-markdown-builder";
  version = "0.6.8";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "liran-funaro";
    repo = "sphinx-markdown-builder";
    tag = version;
    hash = "sha256-dPMOOG3myh9i2ez9uhasqLnlV0BEsE9CHEbZ57VWzAo=";
  };

  patches = [
    # FIX: tests (remove with the next release)
    # https://github.com/liran-funaro/sphinx-markdown-builder/issues/32
    (fetchpatch2 {
      url = "https://github.com/liran-funaro/sphinx-markdown-builder/commit/967edca036a73f7644251abd52a5da8451a10dd4.patch";
      hash = "sha256-FGMYzd5k3Q0UvOccCvUSW3y6gor+AUncj2qv38xyOp4=";
    })
  ];

  build-system = [
    setuptools
    wheel
  ];

  dependencies = [
    docutils
    sphinx
    tabulate
  ];

  optional-dependencies = {
    dev = [
      black
      bumpver
      coveralls
      flake8
      isort
      pip-tools
      pylint
      pytest
      pytest-cov
      sphinx
      sphinxcontrib-httpdomain
      sphinxcontrib-plantuml
    ];
  };

  pythonImportsCheck = [
    "sphinx_markdown_builder"
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  # NOTE: not sure why, but a `Missing dependencies: wheel` error happens when
  # `black` is included here, with python3.13
  checkInputs = lib.remove black optional-dependencies.dev;

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Sphinx extension to add markdown generation support";
    homepage = "https://github.com/liran-funaro/sphinx-markdown-builder";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ eljamm ];
  };
}