python3Packages.sphinx-rtd-theme: fix build

Adds the missing docutils dependency and relaxes its constraint.
Migrates from pytest to pytestCheckHook and moves the CI environment
variable export into preBuild.
This commit is contained in:
Martin Weinelt 2021-06-21 13:32:58 +02:00
parent 09e7ee5393
commit dfa18fb29d

View file

@ -1,9 +1,10 @@
{ lib
, buildPythonPackage
, fetchPypi
, docutils
, sphinx
, readthedocs-sphinx-ext
, pytest
, pytestCheckHook
}:
buildPythonPackage rec {
@ -15,15 +16,26 @@ buildPythonPackage rec {
sha256 = "32bd3b5d13dc8186d7a42fc816a23d32e83a4827d7d9882948e7b837c232da5a";
};
propagatedBuildInputs = [ sphinx ];
checkInputs = [ readthedocs-sphinx-ext pytest ];
CI=1; # Don't use NPM to fetch assets. Assets are included in sdist.
checkPhase = ''
py.test
postPatch = ''
substituteInPlace setup.py \
--replace "docutils<0.17" "docutils"
'';
preBuild = ''
# Don't use NPM to fetch assets. Assets are included in sdist.
export CI=1
'';
propagatedBuildInputs = [
docutils
sphinx
];
checkInputs = [
readthedocs-sphinx-ext
pytestCheckHook
];
meta = with lib; {
description = "ReadTheDocs.org theme for Sphinx";
homepage = "https://github.com/readthedocs/sphinx_rtd_theme";