20 buildPythonPackage rec {
23 format = "setuptools";
26 inherit pname version;
27 hash = "sha256-JcplwaeYlGRAJXRNac1Ya/hgWoHE+NWjZhCU9eaSyRQ=";
30 disabled = pythonOlder "3.8";
32 propagatedBuildInputs = [
48 # patch out pytest-cov dep/invocation
50 substituteInPlace setup.cfg \
51 --replace "--cov=skorch" "" \
52 --replace "--cov-report=term-missing" "" \
53 --replace "--cov-config .coveragerc" ""
58 # on CPU, these expect artifacts from previous GPU run
59 "test_load_cuda_params_to_cpu"
63 ++ lib.optionals stdenv.hostPlatform.isDarwin [
64 # there is a problem with the compiler selection
65 "test_fit_and_predict_with_compile"
67 ++ lib.optionals (pythonAtLeast "3.11") [
68 # Python 3.11+ not yet supported for torch.compile
69 # https://github.com/pytorch/pytorch/blob/v2.0.1/torch/_dynamo/eval_frame.py#L376-L377
70 "test_fit_and_predict_with_compile"
75 # tries to import `transformers` and download HuggingFace data
76 "skorch/tests/test_hf.py"
78 ++ lib.optionals (stdenv.hostPlatform.system != "x86_64-linux") [
79 # torch.distributed is disabled by default in darwin
80 # aarch64-linux also failed these tests
81 "skorch/tests/test_history.py"
84 pythonImportsCheck = [ "skorch" ];
87 description = "Scikit-learn compatible neural net library using Pytorch";
88 homepage = "https://skorch.readthedocs.io";
89 changelog = "https://github.com/skorch-dev/skorch/blob/master/CHANGES.md";
90 license = licenses.bsd3;
91 maintainers = with maintainers; [ bcdarwin ];