19 buildPythonPackage rec {
22 format = "setuptools";
25 inherit pname version;
26 hash = "sha256-39XVBlCmbg162z9uL84GZrU+v+M8waXbGdVV72ZYf84=";
29 disabled = pythonOlder "3.8";
31 propagatedBuildInputs = [
47 # patch out pytest-cov dep/invocation
49 substituteInPlace setup.cfg \
50 --replace "--cov=skorch" "" \
51 --replace "--cov-report=term-missing" "" \
52 --replace "--cov-config .coveragerc" ""
56 # on CPU, these expect artifacts from previous GPU run
57 "test_load_cuda_params_to_cpu"
60 ] ++ lib.optionals stdenv.isDarwin [
61 # there is a problem with the compiler selection
62 "test_fit_and_predict_with_compile"
63 ] ++ lib.optionals (pythonAtLeast "3.11") [
64 # Python 3.11+ not yet supported for torch.compile
65 # https://github.com/pytorch/pytorch/blob/v2.0.1/torch/_dynamo/eval_frame.py#L376-L377
66 "test_fit_and_predict_with_compile"
70 # tries to import `transformers` and download HuggingFace data
71 "skorch/tests/test_hf.py"
72 ] ++ lib.optionals (stdenv.hostPlatform.system != "x86_64-linux") [
73 # torch.distributed is disabled by default in darwin
74 # aarch64-linux also failed these tests
75 "skorch/tests/test_history.py"
78 pythonImportsCheck = [ "skorch" ];
81 description = "Scikit-learn compatible neural net library using Pytorch";
82 homepage = "https://skorch.readthedocs.io";
83 changelog = "https://github.com/skorch-dev/skorch/blob/master/CHANGES.md";
84 license = licenses.bsd3;
85 maintainers = with maintainers; [ bcdarwin ];