1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pytestCheckHook
5, pythonOlder
6, alembic
7, boto3
8, botorch
9, catboost
10, cma
11, cmaes
12, colorlog
13, distributed
14, fakeredis
15, fastai
16, google-cloud-storage
17, lightgbm
18, matplotlib
19, mlflow
20, moto
21, numpy
22, packaging
23, pandas
24, plotly
25, pytest-xdist
26, pytorch-lightning
27, pyyaml
28, redis
29, scikit-learn
30, scikit-optimize
31, scipy
32, setuptools
33, shap
34, sqlalchemy
35, tensorflow
36, torch
37, torchaudio
38, torchvision
39, tqdm
40, wandb
41, wheel
42, xgboost
43}:
44
45buildPythonPackage rec {
46 pname = "optuna";
47 version = "3.4.0";
48 format = "pyproject";
49
50 disabled = pythonOlder "3.7";
51
52 src = fetchFromGitHub {
53 owner = "optuna";
54 repo = "optuna";
55 rev = "refs/tags/v${version}";
56 hash = "sha256-WUjO13NxX0FneOPS4nn6aHq48X95r+GJR/Oxir6n8Pk=";
57 };
58
59 nativeBuildInputs = [
60 setuptools
61 wheel
62 ];
63
64 propagatedBuildInputs = [
65 alembic
66 colorlog
67 numpy
68 packaging
69 sqlalchemy
70 tqdm
71 pyyaml
72 ];
73
74 passthru.optional-dependencies = {
75 integration = [
76 botorch
77 catboost
78 cma
79 distributed
80 fastai
81 lightgbm
82 mlflow
83 pandas
84 # pytorch-ignite
85 pytorch-lightning
86 scikit-learn
87 scikit-optimize
88 shap
89 tensorflow
90 torch
91 torchaudio
92 torchvision
93 wandb
94 xgboost
95 ];
96 optional = [
97 boto3
98 botorch
99 cmaes
100 google-cloud-storage
101 matplotlib
102 pandas
103 plotly
104 redis
105 scikit-learn
106 ];
107 };
108
109 preCheck = ''
110 export PATH=$out/bin:$PATH
111 '';
112
113 nativeCheckInputs = [
114 fakeredis
115 moto
116 pytest-xdist
117 pytestCheckHook
118 scipy
119 ] ++ fakeredis.optional-dependencies.lua
120 ++ passthru.optional-dependencies.optional;
121
122 pytestFlagsArray = [
123 "-m 'not integration'"
124 ];
125
126 disabledTestPaths = [
127 # require unpackaged kaleido and building it is a bit difficult
128 "tests/visualization_tests"
129 ];
130
131 pythonImportsCheck = [
132 "optuna"
133 ];
134
135 meta = with lib; {
136 description = "A hyperparameter optimization framework";
137 homepage = "https://optuna.org/";
138 changelog = "https://github.com/optuna/optuna/releases/tag/${src.rev}";
139 license = licenses.mit;
140 maintainers = with maintainers; [ natsukium ];
141 };
142}