about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/sphinx-prompt/default.nix
blob: 4d96a831d626363c9d4a4964255410057f8b88e0 (plain) (blame)
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
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonRelaxDepsHook

# build-system
, poetry-core
, poetry-dynamic-versioning

# dependencies
, docutils
, pygments
, sphinx

# tests
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "sphinx-prompt";
  version = "1.7.0"; # read before updating past 1.7.0 https://github.com/sbrunner/sphinx-prompt/issues/398
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "sbrunner";
    repo = "sphinx-prompt";
    rev = "refs/tags/${version}";
    hash = "sha256-/XxUSsW8Bowks7P+d6iTlklyMIfTb2otXva/VtRVAkM=";
  };

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace '"poetry-plugin-tweak-dependencies-version", ' ""
  '';

  nativeBuildInputs = [
    poetry-core
    poetry-dynamic-versioning
    pythonRelaxDepsHook
  ];

  pythonRelaxDeps = [
    "docutils"
    "pygments"
    "Sphinx"
  ];

  propagatedBuildInputs = [
    docutils
    pygments
    sphinx
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  # versions >=1.8.0 cannot be build from source
  passthru.skipBulkUpdate = true;

  meta = with lib; {
    description = "A sphinx extension for creating unselectable prompt";
    homepage = "https://github.com/sbrunner/sphinx-prompt";
    license = licenses.bsd3;
    maintainers = with maintainers; [ kaction ];
  };
}