python3.pkgs.hypothesis: build offline documentation

This commit is contained in:
Dmitry Bogatov
2023-01-15 16:16:55 -05:00
committed by Yt
parent c29db3b9fb
commit 35a4ca4bde
6 changed files with 37 additions and 5 deletions
@@ -23,7 +23,8 @@ buildPythonPackage rec {
];
checkInputs = [
hypothesis
# "hypothesis" indirectly depends on chardet to build its documentation.
(hypothesis.override { enableDocumentation = false; })
pytestCheckHook
];
@@ -62,7 +62,8 @@ buildPythonPackage rec {
checkInputs = [
cryptography-vectors
hypothesis
# "hypothesis" indirectly depends on cryptography to build its documentation
(hypothesis.override { enableDocumentation = false; })
iso8601
pretend
py
@@ -9,11 +9,18 @@
, pytest-xdist
, sortedcontainers
, pythonOlder
, sphinxHook
, sphinx-rtd-theme
, sphinx-hoverxref
, sphinx-codeautolink
# Used to break internal dependency loop.
, enableDocumentation ? true
}:
buildPythonPackage rec {
pname = "hypothesis";
version = "6.61.0";
outputs = [ "out" ] ++ lib.optional enableDocumentation "doc";
format = "setuptools";
disabled = pythonOlder "3.7";
@@ -25,8 +32,28 @@ buildPythonPackage rec {
hash = "sha256-gTcdJaOgP8Nc4fN8UH6+sLedivq5ZNxMRULajFOVnSo=";
};
# I tried to package sphinx-selective-exclude, but it throws
# error about "module 'sphinx' has no attribute 'directives'".
#
# It probably has to do with monkey-patching internals of Sphinx.
# On bright side, this extension does not introduces new commands,
# only changes "::only" command, so we probably okay with stock
# implementation.
#
# I wonder how upstream of "hypothesis" builds documentation.
postPatch = ''
sed -i -e '/sphinx_selective_exclude.eager_only/ d' docs/conf.py
'';
postUnpack = "sourceRoot=$sourceRoot/hypothesis-python";
nativeBuildInputs = lib.optionals enableDocumentation [
sphinxHook
sphinx-rtd-theme
sphinx-hoverxref
sphinx-codeautolink
];
propagatedBuildInputs = [
attrs
sortedcontainers
@@ -25,7 +25,8 @@ buildPythonPackage rec {
];
checkInputs = [
hypothesis
# "hypothesis" indirectly depends on iso8601 to build its documentation
(hypothesis.override { enableDocumentation = false; })
pytestCheckHook
pytz
];
@@ -77,7 +77,8 @@ in buildPythonPackage rec {
checkInputs = [
pytest
hypothesis
# "hypothesis" indirectly depends on numpy to build its documentation.
(hypothesis.override { enableDocumentation = false; })
typing-extensions
];
@@ -132,7 +132,8 @@ buildPythonPackage rec {
checkInputs = [
git
glibcLocales
hypothesis
# "hypothesis" indirectly depends on twisted to build its documentation.
(hypothesis.override { enableDocumentation = false; })
pyhamcrest
]
++ passthru.optional-dependencies.conch