nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # build-system
7 poetry-core,
8 poetry-dynamic-versioning,
9
10 # dependencies
11 docutils,
12 pygments,
13 sphinx,
14
15 # tests
16 pytestCheckHook,
17}:
18
19buildPythonPackage rec {
20 pname = "sphinx-prompt";
21 version = "1.10.2";
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "sbrunner";
26 repo = "sphinx-prompt";
27 tag = version;
28 hash = "sha256-ut1g4Clq8mVUYwCe0XMt4GIXUJ4Hy7k8DjWbR7GJ8Bg=";
29 };
30
31 postPatch = ''
32 substituteInPlace pyproject.toml --replace-fail 'version = "0.0.0"' 'version = "${version}"'
33 # create the old sphinx-prompt directory for compatibility
34 # https://github.com/sbrunner/sphinx-prompt/issues/612
35 cp -r sphinx{_,-}prompt
36 '';
37
38 build-system = [
39 poetry-core
40 poetry-dynamic-versioning
41 ];
42
43 dependencies = [
44 docutils
45 pygments
46 sphinx
47 ];
48
49 # upstream pins these unnecessarily in their requirements.txt
50 pythonRelaxDeps = [
51 "certifi"
52 "requests"
53 "urllib3"
54 "zipp"
55 ];
56
57 nativeCheckInputs = [ pytestCheckHook ];
58
59 meta = {
60 description = "Sphinx extension for creating unselectable prompt";
61 homepage = "https://github.com/sbrunner/sphinx-prompt";
62 license = lib.licenses.bsd3;
63 maintainers = with lib.maintainers; [ kaction ];
64 };
65}