16 , enableDimensionalityReduction ? false
20 buildPythonPackage rec {
23 format = "setuptools";
25 disabled = pythonOlder "3.6";
30 sha256 = "sha256-PKmuPI83DPy7RkOgHHPdPJJz5NT/fpr123AVTzTLwgQ=";
38 propagatedBuildInputs = [
41 ] ++ lib.optionals enableGPU [
43 ] ++ lib.optionals enableDimensionalityReduction [
58 substituteInPlace setup.cfg \
59 --replace " --cov-report= --cov=ot" "" \
60 --replace " --durations=20" "" \
61 --replace " --junit-xml=junit-results.xml" ""
62 substituteInPlace setup.py \
63 --replace '"oldest-supported-numpy", ' ""
65 # we don't need setup.py to find the macos sdk for us
66 sed -i '/sdk_path/d' setup.py
69 # To prevent importing of an incomplete package from the build directory
70 # instead of nix store (`ot` is the top-level package name).
76 # GPU tests are always skipped because of sandboxing
78 # Fixture is not available
79 "test_conditional_gradient"
80 "test_convert_between_backends"
82 "test_emd_emd2_types_devices"
83 "test_emd1d_type_devices"
85 "test_factored_ot_backends"
86 "test_free_support_barycenter_backends"
88 "test_generalized_conditional_gradient"
89 "test_line_search_armijo"
91 "test_max_sliced_backend"
93 "test_random_backends"
96 "test_wasserstein_1d_type_devices"
98 "test_weak_ot_bakends"
99 # TypeError: Only integers, slices...
100 "test_emd1d_device_tf"
103 disabledTestPaths = [
104 # AttributeError: module pytest has no attribute skip_backend
105 "test/test_bregman.py"
108 "test/test_gromov.py"
109 "test/test_helpers.py"
110 "test/test_unbalanced.py"
111 ] ++ lib.optionals (!enableDimensionalityReduction) [
115 pythonImportsCheck = [
121 description = "Python Optimal Transport Library";
122 homepage = "https://pythonot.github.io/";
123 license = licenses.mit;
124 maintainers = with maintainers; [ yl3dy ];