1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 docutils,
6 sphinx,
7 readthedocs-sphinx-ext,
8 sphinxcontrib-jquery,
9 pytestCheckHook,
10 pythonRelaxDepsHook,
11}:
12
13buildPythonPackage rec {
14 pname = "sphinx-rtd-theme";
15 version = "2.0.0";
16 format = "setuptools";
17
18 src = fetchPypi {
19 pname = "sphinx_rtd_theme";
20 inherit version;
21 hash = "sha256-vV17gGIkBnYgc6BO+PrcX5FRJhVj1HAn3gmRDOA6/ms=";
22 };
23
24 preBuild = ''
25 # Don't use NPM to fetch assets. Assets are included in sdist.
26 export CI=1
27 '';
28
29 propagatedBuildInputs = [
30 docutils
31 sphinx
32 sphinxcontrib-jquery
33 ];
34
35 nativeBuildInputs = [ pythonRelaxDepsHook ];
36
37 nativeCheckInputs = [
38 pytestCheckHook
39 readthedocs-sphinx-ext
40 ];
41
42 disabledTests = [
43 # docutils 0.21 compat
44 "test_basic"
45 ];
46
47 pythonRelaxDeps = [
48 "docutils"
49 "sphinxcontrib-jquery"
50 ];
51
52 pythonImportsCheck = [ "sphinx_rtd_theme" ];
53
54 meta = with lib; {
55 description = "Sphinx theme for readthedocs.org";
56 homepage = "https://github.com/readthedocs/sphinx_rtd_theme";
57 changelog = "https://github.com/readthedocs/sphinx_rtd_theme/blob/${version}/docs/changelog.rst";
58 license = licenses.mit;
59 };
60}