forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
125 lines (112 loc) · 2.76 KB
/
default.nix
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{ stdenv
, lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, isPyPy
# nativeBuildInputs
, flit-core
# propagatedBuildInputs
, babel
, alabaster
, docutils
, imagesize
, importlib-metadata
, jinja2
, packaging
, pygments
, requests
, snowballstemmer
, sphinxcontrib-apidoc
, sphinxcontrib-applehelp
, sphinxcontrib-devhelp
, sphinxcontrib-htmlhelp
, sphinxcontrib-jsmath
, sphinxcontrib-qthelp
, sphinxcontrib-serializinghtml
, sphinxcontrib-websupport
# check phase
, cython
, filelock
, html5lib
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "sphinx";
version = "7.0.1";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "sphinx-doc";
repo = pname;
rev = "refs/tags/v${version}";
postFetch = ''
# Change ä to æ in file names, since ä can be encoded multiple ways on different
# filesystems, leading to different hashes on different platforms.
cd "$out";
mv tests/roots/test-images/{testimäge,testimæge}.png
sed -i 's/testimäge/testimæge/g' tests/{test_build*.py,roots/test-images/index.rst}
'';
hash = "sha256-DUUdHvmuxWw06ycH6qFE2LZ9GTzOqdvdPnye8cvVBOQ=";
};
nativeBuildInputs = [
flit-core
];
propagatedBuildInputs = [
alabaster
babel
docutils
imagesize
jinja2
packaging
pygments
requests
snowballstemmer
sphinxcontrib-applehelp
sphinxcontrib-devhelp
sphinxcontrib-htmlhelp
sphinxcontrib-jsmath
sphinxcontrib-qthelp
sphinxcontrib-serializinghtml
# extra[docs]
sphinxcontrib-websupport
# extra plugins which are otherwise not found by sphinx-build
sphinxcontrib-apidoc
] ++ lib.optionals (pythonOlder "3.10") [
importlib-metadata
];
__darwinAllowLocalNetworking = true;
nativeCheckInputs = [
cython
filelock
html5lib
pytestCheckHook
];
preCheck = ''
export HOME=$TMPDIR
'';
disabledTests = lib.optionals isPyPy [
# PyPy has not __builtins__ which get asserted
# https://doc.pypy.org/en/latest/cpython_differences.html#miscellaneous
"test_autosummary_generate_content_for_module"
"test_autosummary_generate_content_for_module_skipped"
# internals are asserted which are sightly different in PyPy
"test_autodoc_inherited_members_None"
"test_automethod_for_builtin"
"test_builtin_function"
"test_cython"
"test_isattributedescriptor"
"test_methoddescriptor"
"test_partialfunction"
];
meta = with lib; {
description = "Python documentation generator";
longDescription = ''
A tool that makes it easy to create intelligent and beautiful
documentation for Python projects
'';
homepage = "https://www.sphinx-doc.org";
license = licenses.bsd3;
maintainers = teams.sphinx.members;
};
}