Skip to content

Commit b130c10

Browse files
committed
python3Packages.smolagents: split pytest checks to passthru.tests
Reduce closure size by splitting tests, as the tests depends on optional-dependencies.
1 parent addf7cf commit b130c10

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

pkgs/development/python-modules/smolagents/default.nix

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
wikipedia-api,
5151
}:
5252

53-
buildPythonPackage rec {
53+
(buildPythonPackage rec {
5454
pname = "smolagents";
5555
version = "1.21.3";
5656
pyproject = true;
@@ -122,6 +122,11 @@ buildPythonPackage rec {
122122
# ];
123123
});
124124

125+
# Split install checks to `passthru.tests.pytest-check`
126+
# as it depends on `optional-dependencies`,
127+
# which contains huge stuff like the GUI library `python3Packages.gradio`.
128+
doCheck = false;
129+
125130
nativeCheckInputs = [
126131
ipython
127132
pytest-datadir
@@ -179,4 +184,16 @@ buildPythonPackage rec {
179184
license = lib.licenses.asl20;
180185
maintainers = with lib.maintainers; [ fab ];
181186
};
182-
}
187+
}).overrideAttrs
188+
(
189+
finalAttrs: previousAttrs: {
190+
passthru = previousAttrs.passthru // {
191+
tests = previousAttrs.passthru.tests or { } // {
192+
pytest-check = finalAttrs.overrideAttrs {
193+
# buildPythonPackage maps doCheck to doInstallCheck.
194+
doInstallCheck = true;
195+
};
196+
};
197+
};
198+
}
199+
)

0 commit comments

Comments
 (0)