at 25.11-pre 3.3 kB view raw
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchFromGitHub, 6 7 # build-system 8 setuptools, 9 10 # dependencies 11 alembic, 12 colorlog, 13 numpy, 14 packaging, 15 sqlalchemy, 16 tqdm, 17 pyyaml, 18 19 # optional-dependencies 20 boto3, 21 cmaes, 22 fvcore, 23 google-cloud-storage, 24 grpcio, 25 matplotlib, 26 pandas, 27 plotly, 28 protobuf, 29 redis, 30 scikit-learn, 31 scipy, 32 33 # tests 34 addBinToPathHook, 35 fakeredis, 36 kaleido, 37 moto, 38 pytest-xdist, 39 pytestCheckHook, 40 torch, 41 versionCheckHook, 42}: 43 44buildPythonPackage rec { 45 pname = "optuna"; 46 version = "4.2.1"; 47 pyproject = true; 48 49 src = fetchFromGitHub { 50 owner = "optuna"; 51 repo = "optuna"; 52 tag = "v${version}"; 53 hash = "sha256-WLrdHrdfCtCZMW2J375N8vmod7FcKCMwQPGKicRA878="; 54 }; 55 56 build-system = [ 57 setuptools 58 ]; 59 60 dependencies = [ 61 alembic 62 colorlog 63 numpy 64 packaging 65 sqlalchemy 66 tqdm 67 pyyaml 68 ]; 69 70 optional-dependencies = { 71 optional = [ 72 boto3 73 cmaes 74 fvcore 75 google-cloud-storage 76 grpcio 77 matplotlib 78 pandas 79 plotly 80 protobuf 81 redis 82 scikit-learn 83 scipy 84 ]; 85 }; 86 87 # grpc tests are racy 88 preCheck = '' 89 sed -i '/"grpc",/d' optuna/testing/storages.py 90 ''; 91 92 nativeCheckInputs = 93 [ 94 addBinToPathHook 95 fakeredis 96 kaleido 97 moto 98 pytest-xdist 99 pytestCheckHook 100 torch 101 versionCheckHook 102 ] 103 ++ fakeredis.optional-dependencies.lua 104 ++ optional-dependencies.optional; 105 versionCheckProgramArg = "--version"; 106 107 disabledTests = 108 [ 109 # ValueError: Transform failed with error code 525: error creating static canvas/context for image server 110 "test_get_pareto_front_plot" 111 # too narrow time limit 112 "test_get_timeline_plot_with_killed_running_trials" 113 ] 114 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 115 # ValueError: Failed to start Kaleido subprocess. Error stream 116 # kaleido/executable/kaleido: line 5: 5956 Illegal instruction: 4 ./bin/kaleido $@ 117 "test_get_optimization_history_plot" 118 "test_plot_intermediate_values" 119 "test_plot_rank" 120 "test_plot_terminator_improvement" 121 122 # Fatal Python error: Aborted 123 # matplotlib/backend_bases.py", line 2654 in create_with_canvas 124 "test_edf_plot_no_trials" 125 "test_get_timeline_plot" 126 "test_plot_contour" 127 "test_plot_contour_customized_target_name" 128 "test_plot_edf_with_multiple_studies" 129 "test_plot_edf_with_target" 130 "test_plot_parallel_coordinate" 131 "test_plot_parallel_coordinate_customized_target_name" 132 "test_plot_param_importances" 133 "test_plot_param_importances_customized_target_name" 134 "test_plot_param_importances_multiobjective_all_objectives_displayed" 135 "test_plot_slice" 136 "test_plot_slice_customized_target_name" 137 "test_target_is_none_and_study_is_multi_obj" 138 "test_visualizations_with_single_objectives" 139 ]; 140 141 pythonImportsCheck = [ "optuna" ]; 142 143 meta = { 144 description = "Hyperparameter optimization framework"; 145 homepage = "https://optuna.org/"; 146 changelog = "https://github.com/optuna/optuna/releases/tag/${version}"; 147 license = lib.licenses.mit; 148 maintainers = with lib.maintainers; [ natsukium ]; 149 mainProgram = "optuna"; 150 }; 151}