diff --git a/pkgs/applications/misc/privacyidea/default.nix b/pkgs/applications/misc/privacyidea/default.nix index 768729ad3034..74efc4c1db02 100644 --- a/pkgs/applications/misc/privacyidea/default.nix +++ b/pkgs/applications/misc/privacyidea/default.nix @@ -141,9 +141,6 @@ let sphinxHook = null; sphinx-better-theme = null; }).overridePythonAttrs dropDocOutput; - hypothesis = super.hypothesis.override { - enableDocumentation = false; - }; pyjwt = (super.pyjwt.override { sphinxHook = null; sphinx-rtd-theme = null; diff --git a/pkgs/development/python-modules/chardet/default.nix b/pkgs/development/python-modules/chardet/default.nix index e750bbece81d..69353dcaec28 100644 --- a/pkgs/development/python-modules/chardet/default.nix +++ b/pkgs/development/python-modules/chardet/default.nix @@ -23,8 +23,7 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - # "hypothesis" indirectly depends on chardet to build its documentation. - (hypothesis.override { enableDocumentation = false; }) + hypothesis pytestCheckHook ]; diff --git a/pkgs/development/python-modules/cryptography/default.nix b/pkgs/development/python-modules/cryptography/default.nix index 4815bfe90559..02a960ac48f4 100644 --- a/pkgs/development/python-modules/cryptography/default.nix +++ b/pkgs/development/python-modules/cryptography/default.nix @@ -72,8 +72,7 @@ buildPythonPackage rec { nativeCheckInputs = [ cryptography-vectors - # "hypothesis" indirectly depends on cryptography to build its documentation - (hypothesis.override { enableDocumentation = false; }) + hypothesis iso8601 pretend py diff --git a/pkgs/development/python-modules/hypothesis/default.nix b/pkgs/development/python-modules/hypothesis/default.nix index bfa2ca0dc87e..fab840a74e99 100644 --- a/pkgs/development/python-modules/hypothesis/default.nix +++ b/pkgs/development/python-modules/hypothesis/default.nix @@ -8,21 +8,21 @@ , doCheck ? true , pytestCheckHook , pytest-xdist +, python , sortedcontainers +, stdenv , pythonOlder , sphinxHook , sphinx-rtd-theme , sphinx-hoverxref , sphinx-codeautolink , tzdata -# Used to break internal dependency loop. -, enableDocumentation ? true }: buildPythonPackage rec { pname = "hypothesis"; version = "6.68.2"; - outputs = [ "out" ] ++ lib.optional enableDocumentation "doc"; + outputs = [ "out" ]; format = "setuptools"; disabled = pythonOlder "3.7"; @@ -49,13 +49,6 @@ buildPythonPackage rec { postUnpack = "sourceRoot=$sourceRoot/hypothesis-python"; - nativeBuildInputs = lib.optionals enableDocumentation [ - sphinxHook - sphinx-rtd-theme - sphinx-hoverxref - sphinx-codeautolink - ]; - propagatedBuildInputs = [ attrs sortedcontainers @@ -67,7 +60,7 @@ buildPythonPackage rec { pexpect pytest-xdist pytestCheckHook - ] ++ lib.optionals (isPyPy) [ + ] ++ lib.optionals isPyPy [ tzdata ]; @@ -86,6 +79,30 @@ buildPythonPackage rec { "hypothesis" ]; + passthru = { + doc = stdenv.mkDerivation { + # Forge look and feel of multi-output derivation as best as we can. + # + # Using 'outputs = [ "doc" ];' breaks a lot of assumptions. + name = "${pname}-${version}-doc"; + inherit src pname version; + + postInstallSphinx = '' + mv $out/share/doc/* $out/share/doc/python$pythonVersion-$pname-$version + ''; + + nativeBuildInputs = [ + sphinxHook + sphinx-rtd-theme + sphinx-hoverxref + sphinx-codeautolink + ]; + + inherit (python) pythonVersion; + inherit meta; + }; + }; + meta = with lib; { description = "Library for property based testing"; homepage = "https://github.com/HypothesisWorks/hypothesis"; diff --git a/pkgs/development/python-modules/iso8601/default.nix b/pkgs/development/python-modules/iso8601/default.nix index af90e739163c..c3e022cdb38b 100644 --- a/pkgs/development/python-modules/iso8601/default.nix +++ b/pkgs/development/python-modules/iso8601/default.nix @@ -25,8 +25,7 @@ buildPythonPackage rec { ]; nativeCheckInputs = [ - # "hypothesis" indirectly depends on iso8601 to build its documentation - (hypothesis.override { enableDocumentation = false; }) + hypothesis pytestCheckHook pytz ]; diff --git a/pkgs/development/python-modules/numpy/default.nix b/pkgs/development/python-modules/numpy/default.nix index 401a1120527a..d96d2c13515e 100644 --- a/pkgs/development/python-modules/numpy/default.nix +++ b/pkgs/development/python-modules/numpy/default.nix @@ -76,8 +76,7 @@ in buildPythonPackage rec { nativeCheckInputs = [ pytest - # "hypothesis" indirectly depends on numpy to build its documentation. - (hypothesis.override { enableDocumentation = false; }) + hypothesis typing-extensions ]; diff --git a/pkgs/development/python-modules/pandas/default.nix b/pkgs/development/python-modules/pandas/default.nix index 68d925cc2a9f..d74c63b1030b 100644 --- a/pkgs/development/python-modules/pandas/default.nix +++ b/pkgs/development/python-modules/pandas/default.nix @@ -44,8 +44,7 @@ buildPythonPackage rec { nativeCheckInputs = [ glibcLocales - # hypothesis indirectly depends on pandas to build its documentation - (hypothesis.override { enableDocumentation = false; }) + hypothesis jinja2 pytest-asyncio pytest-xdist diff --git a/pkgs/development/python-modules/twisted/default.nix b/pkgs/development/python-modules/twisted/default.nix index f45acbe87a4e..0731822c3bc6 100644 --- a/pkgs/development/python-modules/twisted/default.nix +++ b/pkgs/development/python-modules/twisted/default.nix @@ -159,8 +159,7 @@ buildPythonPackage rec { nativeCheckInputs = [ git glibcLocales - # "hypothesis" indirectly depends on twisted to build its documentation. - (hypothesis.override { enableDocumentation = false; }) + hypothesis pyhamcrest ] ++ passthru.optional-dependencies.conch