summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandro Jäckel <sandro.jaeckel@gmail.com>2023-05-22 18:18:32 +0200
committerSandro Jäckel <sandro.jaeckel@gmail.com>2023-05-22 18:18:32 +0200
commit0000022b48036f65ebc514fbb7c89071aea1248d (patch)
tree06b89f9329b6dff1731a0e1c2c633dca9b205c19
parenta4b25ea80898ea87ec2427719f2ec2dee427019a (diff)
python310Packages.hypothesis: move documentation to passthru to reduce dependencies
-rw-r--r--pkgs/development/python-modules/hypothesis/default.nix39
1 files changed, 28 insertions, 11 deletions
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";