|
1 | 1 | { |
2 | 2 | lib, |
| 3 | + stdenv, |
3 | 4 | buildPythonPackage, |
4 | 5 | fetchFromGitHub, |
5 | | - pytestCheckHook, |
6 | | - pythonOlder, |
| 6 | + |
| 7 | + # build-system |
| 8 | + setuptools, |
| 9 | + |
| 10 | + # dependencies |
7 | 11 | alembic, |
| 12 | + colorlog, |
| 13 | + numpy, |
| 14 | + packaging, |
| 15 | + sqlalchemy, |
| 16 | + tqdm, |
| 17 | + pyyaml, |
| 18 | + |
| 19 | + # optional-dependencies |
8 | 20 | boto3, |
9 | 21 | cmaes, |
10 | | - colorlog, |
11 | | - fakeredis, |
12 | 22 | fvcore, |
13 | 23 | google-cloud-storage, |
14 | 24 | grpcio, |
15 | | - kaleido, |
16 | 25 | matplotlib, |
17 | | - moto, |
18 | | - numpy, |
19 | | - packaging, |
20 | 26 | pandas, |
21 | 27 | plotly, |
22 | 28 | protobuf, |
23 | | - pytest-xdist, |
24 | | - pyyaml, |
25 | 29 | redis, |
26 | 30 | scikit-learn, |
27 | 31 | scipy, |
28 | | - setuptools, |
29 | | - sqlalchemy, |
| 32 | + |
| 33 | + # tests |
| 34 | + addBinToPathHook, |
| 35 | + fakeredis, |
| 36 | + kaleido, |
| 37 | + moto, |
| 38 | + pytest-xdist, |
| 39 | + pytestCheckHook, |
30 | 40 | torch, |
31 | | - tqdm, |
| 41 | + versionCheckHook, |
32 | 42 | }: |
33 | 43 |
|
34 | 44 | buildPythonPackage rec { |
35 | 45 | pname = "optuna"; |
36 | | - version = "4.2.0"; |
| 46 | + version = "4.2.1"; |
37 | 47 | pyproject = true; |
38 | 48 |
|
39 | | - disabled = pythonOlder "3.8"; |
40 | | - |
41 | 49 | src = fetchFromGitHub { |
42 | 50 | owner = "optuna"; |
43 | 51 | repo = "optuna"; |
44 | 52 | tag = "v${version}"; |
45 | | - hash = "sha256-NNlwrVrGg2WvkC42nmW7K/mRktE3B97GaL8GaSOKF1Y="; |
| 53 | + hash = "sha256-WLrdHrdfCtCZMW2J375N8vmod7FcKCMwQPGKicRA878="; |
46 | 54 | }; |
47 | 55 |
|
48 | 56 | build-system = [ |
@@ -76,40 +84,68 @@ buildPythonPackage rec { |
76 | 84 | ]; |
77 | 85 | }; |
78 | 86 |
|
| 87 | + # grpc tests are racy |
79 | 88 | preCheck = '' |
80 | | - export PATH=$out/bin:$PATH |
81 | | -
|
82 | | - # grpc tests are racy |
83 | 89 | sed -i '/"grpc",/d' optuna/testing/storages.py |
84 | 90 | ''; |
85 | 91 |
|
86 | 92 | nativeCheckInputs = |
87 | 93 | [ |
| 94 | + addBinToPathHook |
88 | 95 | fakeredis |
89 | 96 | kaleido |
90 | 97 | moto |
91 | 98 | pytest-xdist |
92 | 99 | pytestCheckHook |
93 | 100 | torch |
| 101 | + versionCheckHook |
94 | 102 | ] |
95 | 103 | ++ fakeredis.optional-dependencies.lua |
96 | 104 | ++ optional-dependencies.optional; |
| 105 | + versionCheckProgramArg = [ "--version" ]; |
97 | 106 |
|
98 | | - disabledTests = [ |
99 | | - # ValueError: Transform failed with error code 525: error creating static canvas/context for image server |
100 | | - "test_get_pareto_front_plot" |
101 | | - # too narrow time limit |
102 | | - "test_get_timeline_plot_with_killed_running_trials" |
103 | | - ]; |
| 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 | + ]; |
104 | 140 |
|
105 | 141 | pythonImportsCheck = [ "optuna" ]; |
106 | 142 |
|
107 | | - meta = with lib; { |
| 143 | + meta = { |
108 | 144 | description = "Hyperparameter optimization framework"; |
109 | 145 | homepage = "https://optuna.org/"; |
110 | 146 | changelog = "https://github.com/optuna/optuna/releases/tag/${version}"; |
111 | | - license = licenses.mit; |
112 | | - maintainers = with maintainers; [ natsukium ]; |
| 147 | + license = lib.licenses.mit; |
| 148 | + maintainers = with lib.maintainers; [ natsukium ]; |
113 | 149 | mainProgram = "optuna"; |
114 | 150 | }; |
115 | 151 | } |
0 commit comments