1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 pythonOlder,
7 setuptools,
8 sphinx,
9 sphinx-autoapi,
10 sphinx-prompt,
11 sphinx-rtd-theme,
12 sphinx-tabs,
13 sphinxemoji,
14 sphinxHook,
15}:
16
17# Latest tagged release release "1.1.2" (Nov 2018) does not contain
18# documentation, it was added in commits Aug 10, 2019. Repository does not have
19# any activity since then.
20buildPythonPackage {
21 pname = "sphinx-version-warning";
22 version = "unstable-2019-08-10";
23 pyproject = true;
24
25 disabled = pythonOlder "3.7";
26
27 outputs = [
28 "out"
29 "doc"
30 ];
31
32 src = fetchFromGitHub {
33 owner = "humitos";
34 repo = "sphinx-version-warning";
35 rev = "a82156c2ea08e5feab406514d0ccd9d48a345f48";
36 hash = "sha256-WnJYMk1gPLT0dBn7lmxVDNVkLYkDCgQOtM9fQ3kc6k0=";
37 };
38
39 # It tries to write to file relative to it own location at runtime
40 # and gets permission denied, since Nix store is immutable.
41 patches = [
42 (fetchpatch {
43 url = "https://github.com/humitos/sphinx-version-warning/commit/cb1b47becf2a0d3b2570ca9929f42f7d7e472b6f.patch";
44 hash = "sha256-Vj0QAHIBmc0VxE+TTmJePzvr5nc45Sn2qqM+C/pkgtM=";
45 })
46 ];
47
48 nativeBuildInputs = [
49 sphinx-autoapi
50 sphinx-prompt
51 sphinx-rtd-theme
52 sphinx-tabs
53 sphinxemoji
54 sphinxHook
55 setuptools
56 ];
57
58 buildInputs = [ sphinx ];
59
60 pythonImportsCheck = [ "versionwarning" ];
61
62 meta = with lib; {
63 description = "Sphinx extension to show a warning banner at the top of your documentation";
64 homepage = "https://github.com/humitos/sphinx-version-warning";
65 changelog = "https://github.com/humitos/sphinx-version-warning/blob/${version}/CHANGELOG.rst";
66 license = licenses.mit;
67 maintainers = with maintainers; [ kaction ];
68 };
69}