1{ lib
2, stdenv
3, appdirs
4, azure-core
5, bokeh
6, boto3
7, buildPythonPackage
8, click
9, docker_pycreds
10, fetchFromGitHub
11, flask
12, git
13, gitpython
14, google-cloud-compute
15, google-cloud-storage
16, hypothesis
17, jsonref
18, jsonschema
19, keras
20, kubernetes
21, matplotlib
22, mlflow
23, nbclient
24, nbformat
25, pandas
26, parameterized
27, pathtools
28, promise
29, protobuf
30, psutil
31, pydantic
32, pyfakefs
33, pytest-mock
34, pytest-xdist
35, pytestCheckHook
36, pythonOlder
37, pythonRelaxDepsHook
38, pyyaml
39, requests
40, responses
41, scikit-learn
42, sentry-sdk
43, setproctitle
44, setuptools
45, shortuuid
46, substituteAll
47, tensorflow
48, torch
49, tqdm
50}:
51
52buildPythonPackage rec {
53 pname = "wandb";
54 version = "0.15.3";
55 format = "setuptools";
56
57 disabled = pythonOlder "3.6";
58
59 src = fetchFromGitHub {
60 owner = pname;
61 repo = pname;
62 rev = "refs/tags/v${version}";
63 hash = "sha256-i1Lo6xbkCgRTJwRjk2bXkZ5a/JRUCzFzmEuPQlPvZf4=";
64 };
65
66 patches = [
67 # Replace git paths
68 (substituteAll {
69 src = ./hardcode-git-path.patch;
70 git = "${lib.getBin git}/bin/git";
71 })
72 ];
73
74 nativeBuildInputs = [
75 pythonRelaxDepsHook
76 ];
77
78 # setuptools is necessary since pkg_resources is required at runtime.
79 propagatedBuildInputs = [
80 appdirs
81 click
82 docker_pycreds
83 gitpython
84 pathtools
85 promise
86 protobuf
87 psutil
88 pyyaml
89 requests
90 sentry-sdk
91 setproctitle
92 setuptools
93 shortuuid
94 ];
95
96 nativeCheckInputs = [
97 azure-core
98 bokeh
99 boto3
100 flask
101 google-cloud-compute
102 google-cloud-storage
103 hypothesis
104 jsonref
105 jsonschema
106 keras
107 kubernetes
108 matplotlib
109 mlflow
110 nbclient
111 nbformat
112 pandas
113 parameterized
114 pydantic
115 pyfakefs
116 pytest-mock
117 pytest-xdist
118 pytestCheckHook
119 responses
120 scikit-learn
121 tensorflow
122 torch
123 tqdm
124 ];
125
126 # Set BOKEH_CDN_VERSION to stop bokeh throwing an exception in tests
127 preCheck = ''
128 export HOME=$(mktemp -d)
129 export BOKEH_CDN_VERSION=${bokeh.version}
130 '';
131
132 pythonRelaxDeps = [ "protobuf" ];
133
134 disabledTestPaths = [
135 # Tests that try to get chatty over sockets or spin up servers, not possible in the nix build environment.
136 "tests/pytest_tests/system_tests/test_notebooks/test_notebooks.py"
137 "tests/pytest_tests/unit_tests_old/test_cli.py"
138 "tests/pytest_tests/unit_tests_old/test_data_types.py"
139 "tests/pytest_tests/unit_tests_old/test_file_stream.py"
140 "tests/pytest_tests/unit_tests_old/test_file_upload.py"
141 "tests/pytest_tests/unit_tests_old/test_footer.py"
142 "tests/pytest_tests/unit_tests_old/test_internal_api.py"
143 "tests/pytest_tests/unit_tests_old/test_keras.py"
144 "tests/pytest_tests/unit_tests_old/test_logging.py"
145 "tests/pytest_tests/unit_tests_old/test_metric_internal.py"
146 "tests/pytest_tests/unit_tests_old/test_public_api.py"
147 "tests/pytest_tests/unit_tests_old/test_runtime.py"
148 "tests/pytest_tests/unit_tests_old/test_sender.py"
149 "tests/pytest_tests/unit_tests_old/test_summary.py"
150 "tests/pytest_tests/unit_tests_old/test_tb_watcher.py"
151 "tests/pytest_tests/unit_tests_old/test_time_resolution.py"
152 "tests/pytest_tests/unit_tests_old/test_wandb_agent.py"
153 "tests/pytest_tests/unit_tests_old/test_wandb_artifacts.py"
154 "tests/pytest_tests/unit_tests_old/test_wandb_integration.py"
155 "tests/pytest_tests/unit_tests_old/test_wandb_run.py"
156 "tests/pytest_tests/unit_tests_old/test_wandb.py"
157 "tests/pytest_tests/unit_tests_old/tests_launch/test_launch_aws.py"
158 "tests/pytest_tests/unit_tests_old/tests_launch/test_launch_cli.py"
159 "tests/pytest_tests/unit_tests_old/tests_launch/test_launch_docker.py"
160 "tests/pytest_tests/unit_tests_old/tests_launch/test_launch_kubernetes.py"
161 "tests/pytest_tests/unit_tests_old/tests_launch/test_launch.py"
162 "tests/pytest_tests/unit_tests/test_cli.py"
163 "tests/pytest_tests/unit_tests/test_data_types.py"
164 "tests/pytest_tests/unit_tests/test_internal_api.py"
165 "tests/pytest_tests/unit_tests/test_mode_disabled.py"
166 "tests/pytest_tests/unit_tests/test_model_workflows.py"
167 "tests/pytest_tests/unit_tests/test_plots.py"
168 "tests/pytest_tests/unit_tests/test_public_api.py"
169 "tests/pytest_tests/unit_tests/test_sender.py"
170 "tests/pytest_tests/unit_tests/test_util.py"
171 "tests/pytest_tests/unit_tests/test_wandb_verify.py"
172
173 # Requires docker access
174 "tests/pytest_tests/system_tests/test_artifacts/test_artifact_saver.py"
175 "tests/pytest_tests/system_tests/test_artifacts/test_wandb_artifacts_full.py"
176 "tests/pytest_tests/system_tests/test_artifacts/test_wandb_artifacts.py"
177 "tests/pytest_tests/system_tests/test_core/test_cli_full.py"
178 "tests/pytest_tests/system_tests/test_core/test_data_types_full.py"
179 "tests/pytest_tests/system_tests/test_core/test_file_stream_internal.py"
180 "tests/pytest_tests/system_tests/test_core/test_file_upload.py"
181 "tests/pytest_tests/system_tests/test_core/test_footer.py"
182 "tests/pytest_tests/system_tests/test_core/test_keras_full.py"
183 "tests/pytest_tests/system_tests/test_core/test_label_full.py"
184 "tests/pytest_tests/system_tests/test_core/test_metric_full.py"
185 "tests/pytest_tests/system_tests/test_core/test_metric_internal.py"
186 "tests/pytest_tests/system_tests/test_core/test_mode_disabled_full.py"
187 "tests/pytest_tests/system_tests/test_core/test_model_workflow.py"
188 "tests/pytest_tests/system_tests/test_core/test_mp_full.py"
189 "tests/pytest_tests/system_tests/test_core/test_public_api.py"
190 "tests/pytest_tests/system_tests/test_core/test_redir_full.py"
191 "tests/pytest_tests/system_tests/test_core/test_report_api.py"
192 "tests/pytest_tests/system_tests/test_core/test_runtime.py"
193 "tests/pytest_tests/system_tests/test_core/test_save_policies.py"
194 "tests/pytest_tests/system_tests/test_core/test_sender.py"
195 "tests/pytest_tests/system_tests/test_core/test_start_method.py"
196 "tests/pytest_tests/system_tests/test_core/test_system_info.py"
197 "tests/pytest_tests/system_tests/test_core/test_tb_watcher.py"
198 "tests/pytest_tests/system_tests/test_core/test_telemetry_full.py"
199 "tests/pytest_tests/system_tests/test_core/test_time_resolution.py"
200 "tests/pytest_tests/system_tests/test_core/test_torch_full.py"
201 "tests/pytest_tests/system_tests/test_core/test_validation_data_logger.py"
202 "tests/pytest_tests/system_tests/test_core/test_wandb_integration.py"
203 "tests/pytest_tests/system_tests/test_core/test_wandb_run.py"
204 "tests/pytest_tests/system_tests/test_core/test_wandb_settings.py"
205 "tests/pytest_tests/system_tests/test_core/test_wandb_tensorflow.py"
206 "tests/pytest_tests/system_tests/test_core/test_wandb_verify.py"
207 "tests/pytest_tests/system_tests/test_core/test_wandb.py"
208 "tests/pytest_tests/system_tests/test_importers/test_import_mlflow.py"
209 "tests/pytest_tests/system_tests/test_sweep/test_public_api.py"
210 "tests/pytest_tests/system_tests/test_sweep/test_sweep_scheduler.py"
211 "tests/pytest_tests/system_tests/test_sweep/test_sweep_utils.py"
212 "tests/pytest_tests/system_tests/test_sweep/test_wandb_agent_full.py"
213 "tests/pytest_tests/system_tests/test_sweep/test_wandb_agent.py"
214 "tests/pytest_tests/system_tests/test_sweep/test_wandb_sweep.py"
215 "tests/pytest_tests/system_tests/test_system_metrics/test_open_metrics.py"
216 "tests/pytest_tests/system_tests/tests_launch/test_github_reference.py"
217 "tests/pytest_tests/system_tests/tests_launch/test_job.py"
218 "tests/pytest_tests/system_tests/tests_launch/test_launch_add.py"
219 "tests/pytest_tests/system_tests/tests_launch/test_launch_cli.py"
220 "tests/pytest_tests/system_tests/tests_launch/test_launch_kubernetes.py"
221 "tests/pytest_tests/system_tests/tests_launch/test_launch_local_container.py"
222 "tests/pytest_tests/system_tests/tests_launch/test_launch_run.py"
223 "tests/pytest_tests/system_tests/tests_launch/test_launch_sweep_cli.py"
224 "tests/pytest_tests/system_tests/tests_launch/test_launch_sweep.py"
225 "tests/pytest_tests/system_tests/tests_launch/test_launch.py"
226 "tests/pytest_tests/system_tests/tests_launch/test_wandb_reference.py"
227
228 # Tries to access /homeless-shelter
229 "tests/pytest_tests/unit_tests/test_tables.py"
230
231 # E AssertionError: assert 'Cannot use both --async and --queue with wandb launch' in 'wandb: ERROR Find detailed error logs at: /build/source/wandb/debug-cli.nixbld.log\nError: The wandb service process exited with 1. Ensure that `sys.executable` is a valid python interpreter. You can override it with the `_executable` setting or with the `WANDB__EXECUTABLE` environment variable.\n'
232 # E + where 'wandb: ERROR Find detailed error logs at: /build/source/wandb/debug-cli.nixbld.log\nError: The wandb service process exited with 1. Ensure that `sys.executable` is a valid python interpreter. You can override it with the `_executable` setting or with the `WANDB__EXECUTABLE` environment variable.\n' = <Result SystemExit(1)>.output
233 "tests/pytest_tests/unit_tests_old/tests_launch/test_launch_jobs.py"
234
235 # Requires google-cloud-aiplatform which is not packaged as of 2023-04-25.
236 "tests/pytest_tests/unit_tests_old/tests_launch/test_launch_gcp.py"
237
238 # Requires google-cloud-artifact-registry which is not packaged as of 2023-04-25.
239 "tests/pytest_tests/unit_tests_old/tests_launch/test_kaniko_build.py"
240 "tests/pytest_tests/unit_tests/test_launch/test_registry/test_gcp_artifact_registry.py"
241
242 # Requires kfp which is not packaged as of 2023-04-25.
243 "tests/pytest_tests/system_tests/test_core/test_kfp.py"
244
245 # Requires metaflow which is not packaged as of 2023-04-25.
246 "tests/pytest_tests/unit_tests/test_metaflow.py"
247
248 # See https://github.com/wandb/wandb/issues/5423
249 "tests/pytest_tests/unit_tests/test_docker.py"
250 "tests/pytest_tests/unit_tests/test_library_public.py"
251 ] ++ lib.optionals stdenv.isLinux [
252 # Same as above
253 "tests/pytest_tests/unit_tests/test_artifacts/test_storage.py"
254 ] ++ lib.optionals stdenv.isDarwin [
255 # Same as above
256 "tests/pytest_tests/unit_tests/test_lib/test_filesystem.py"
257 ];
258
259 # Disable test that fails on darwin due to issue with python3Packages.psutil:
260 # https://github.com/giampaolo/psutil/issues/1219
261 disabledTests = lib.optionals stdenv.isDarwin [
262 "test_tpu_system_stats"
263 ];
264
265 pythonImportsCheck = [
266 "wandb"
267 ];
268
269 meta = with lib; {
270 description = "A CLI and library for interacting with the Weights and Biases API";
271 homepage = "https://github.com/wandb/wandb";
272 changelog = "https://github.com/wandb/wandb/raw/v${version}/CHANGELOG.md";
273 license = licenses.mit;
274 maintainers = with maintainers; [ samuela ];
275 };
276}