caudex 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. caudex-0.2.0/LICENSE +201 -0
  2. caudex-0.2.0/PKG-INFO +339 -0
  3. caudex-0.2.0/README.md +305 -0
  4. caudex-0.2.0/caudex/__init__.py +20 -0
  5. caudex-0.2.0/caudex/__main__.py +13 -0
  6. caudex-0.2.0/caudex/api.py +1050 -0
  7. caudex-0.2.0/caudex/cli.py +2169 -0
  8. caudex-0.2.0/caudex/identity.py +170 -0
  9. caudex-0.2.0/caudex/migrate.py +164 -0
  10. caudex-0.2.0/caudex/notebook.py +249 -0
  11. caudex-0.2.0/caudex/paths.py +297 -0
  12. caudex-0.2.0/caudex/py.typed +0 -0
  13. caudex-0.2.0/caudex/runtime.py +210 -0
  14. caudex-0.2.0/caudex/session.py +166 -0
  15. caudex-0.2.0/caudex/ui.py +395 -0
  16. caudex-0.2.0/caudex.egg-info/PKG-INFO +339 -0
  17. caudex-0.2.0/caudex.egg-info/SOURCES.txt +34 -0
  18. caudex-0.2.0/caudex.egg-info/dependency_links.txt +1 -0
  19. caudex-0.2.0/caudex.egg-info/entry_points.txt +2 -0
  20. caudex-0.2.0/caudex.egg-info/requires.txt +10 -0
  21. caudex-0.2.0/caudex.egg-info/top_level.txt +1 -0
  22. caudex-0.2.0/pyproject.toml +93 -0
  23. caudex-0.2.0/setup.cfg +4 -0
  24. caudex-0.2.0/tests/test_api_cache.py +461 -0
  25. caudex-0.2.0/tests/test_build_spec.py +244 -0
  26. caudex-0.2.0/tests/test_command_surface.py +664 -0
  27. caudex-0.2.0/tests/test_dataset_refs.py +199 -0
  28. caudex-0.2.0/tests/test_identity.py +221 -0
  29. caudex-0.2.0/tests/test_init_merge.py +238 -0
  30. caudex-0.2.0/tests/test_migrate.py +183 -0
  31. caudex-0.2.0/tests/test_output_manifest.py +248 -0
  32. caudex-0.2.0/tests/test_project_guard.py +70 -0
  33. caudex-0.2.0/tests/test_runtime_safety.py +185 -0
  34. caudex-0.2.0/tests/test_timeout.py +411 -0
  35. caudex-0.2.0/tests/test_tracker_restore.py +152 -0
  36. caudex-0.2.0/tests/test_ui_surface.py +337 -0
caudex-0.2.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+  Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Sohanur Islam Shuvo
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
caudex-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,339 @@
1
+ Metadata-Version: 2.4
2
+ Name: caudex
3
+ Version: 0.2.0
4
+ Summary: Run Jupyter notebooks on Kaggle's GPUs from your terminal
5
+ Author-email: Sohanur Islam Shuvo <mdsohanurislamshuvo@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://pypi.org/project/caudex/
8
+ Project-URL: Changelog, https://pypi.org/project/caudex/#history
9
+ Keywords: kaggle,jupyter,notebook,gpu,cli,machine-learning
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Scientific/Engineering
20
+ Classifier: Topic :: Utilities
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: click<9,>=8.2
25
+ Requires-Dist: kaggle<3,>=2.2.4
26
+ Requires-Dist: platformdirs<6,>=4
27
+ Requires-Dist: rich<16,>=13
28
+ Provides-Extra: dev
29
+ Requires-Dist: pytest>=8.0; extra == "dev"
30
+ Requires-Dist: pyinstaller>=6.0; extra == "dev"
31
+ Requires-Dist: build>=1.0; extra == "dev"
32
+ Requires-Dist: twine>=6.1; extra == "dev"
33
+ Dynamic: license-file
34
+
35
+ # caudex
36
+
37
+ Run Jupyter notebooks on Kaggle's GPUs from your terminal.
38
+
39
+ `caudex` wraps the official Kaggle SDK so you can scaffold a notebook project, push it,
40
+ watch it run, and pull the results back — without touching the web UI. It uses your own
41
+ Kaggle account and your own quota. Nothing is proxied through anyone else's servers.
42
+
43
+ The loop it replaces looks like this: edit a notebook locally, upload it in a browser tab,
44
+ pick an accelerator from a dropdown, refresh the page until the run ends, then download a
45
+ zip. `caudex execute` is that whole loop in one command, with the logs streaming to your
46
+ terminal and the outputs landing in a directory you chose.
47
+
48
+ > **caudex 0.2.0** — formerly `kaggle-bridge`, command `kbr`. If you are upgrading, read
49
+ > [Breaking changes in 0.2.0](#breaking-changes-in-020); the short version is that the
50
+ > command is called `caudex` now, your config migrates itself, and a timeout exits **124**
51
+ > instead of 1.
52
+
53
+ ---
54
+
55
+ ## Install
56
+
57
+ From a checkout:
58
+
59
+ ```bash
60
+ pip install -e .
61
+ caudex --help
62
+ ```
63
+
64
+ On Windows you can also build a standalone installer that needs no Python at all — see
65
+ [Building the Windows installer](#development). It is a per-user install: no administrator
66
+ rights, it adds itself to your user `PATH`, and it offers to run `caudex auth --setup` when
67
+ it finishes. No prebuilt installer is published yet; `pip install caudex` is the supported
68
+ route today.
69
+
70
+ Requires Python 3.9+ and a Kaggle account. The Kaggle SDK is a hard dependency and is
71
+ installed with the package.
72
+
73
+ ---
74
+
75
+ ## Quickstart
76
+
77
+ ```bash
78
+ caudex auth --setup # store your API token, once
79
+ caudex init train.ipynb --gpu --dir ./exp # scaffold a project
80
+ # ... edit ./exp/train.ipynb ...
81
+ caudex execute --dir ./exp # push, stream logs, pull results
82
+ ```
83
+
84
+ Get an API token at **kaggle.com → Settings → API → Create New Token**. That downloads a
85
+ `kaggle.json`; `caudex auth --setup` will ask you for the two values inside it and write
86
+ them to `~/.kaggle/kaggle.json`, which is the Kaggle SDK's own file and is shared with the
87
+ `kaggle` CLI if you also have that installed.
88
+
89
+ Anything your notebook writes to `/kaggle/working/` comes back:
90
+
91
+ ```python
92
+ # inside the notebook
93
+ model.save("/kaggle/working/model.keras")
94
+ df.to_csv("/kaggle/working/scores.csv", index=False)
95
+ ```
96
+
97
+ ```bash
98
+ caudex pull --dir ./exp # -> <output_dir>/<owner>_<slug>/
99
+ ```
100
+
101
+ ---
102
+
103
+ ## Commands
104
+
105
+ `caudex --help` for the full text; `caudex COMMAND --help` for any one of them.
106
+
107
+ ### Running notebooks
108
+
109
+ | Command | What it does |
110
+ |---|---|
111
+ | `caudex init [NOTEBOOK]` | Scaffold a notebook + `kernel-metadata.json` in a directory. `--gpu`, `--internet`, `--dir`, `--force` |
112
+ | `caudex push` | Push the local notebook to Kaggle and start a run. `--dir`, `--gpu`, `--no-gpu` |
113
+ | `caudex execute [NOTEBOOK]` | **The main command.** Push, stream logs, wait, pull outputs, print a per-cell report. `--runtime`, `--gpu/--no-gpu`, `--output-dir`, `--interval`, `--timeout`, `--pull-notebook`, `--no-pull`, `--no-cell-report`, `--on-timeout` |
114
+ | `caudex watch [KERNEL_REF]` | Poll an already-running kernel until it finishes. `--interval`, `--timeout`, `--on-timeout` |
115
+ | `caudex status [KERNEL_REF]` | Print the current run state and exit. |
116
+ | `caudex logs [KERNEL_REF]` | Print a run's log. `--follow` to stream, `--tail N` for the last N lines, `--output FILE` to also save a copy |
117
+ | `caudex pull [KERNEL_REF]` | Download output files from the last completed run. `--output-dir`, `--pull-notebook` |
118
+ | `caudex run` | *Deprecated.* `execute` with log streaming and the cell report turned off. |
119
+
120
+ ### Account
121
+
122
+ | Command | What it does |
123
+ |---|---|
124
+ | `caudex auth` | Manage credentials and the local session. `--setup`, `--status`, `--logout`, `--session-ttl DAYS` |
125
+ | `caudex whoami` | Print the authenticated Kaggle username. |
126
+ | `caudex quota` | Remaining weekly GPU and TPU quota on your account. |
127
+ | `caudex notebooks` | List your Kaggle notebooks. `--search`, `--all`, `--limit` |
128
+
129
+ ### Runtimes — `caudex runtime`
130
+
131
+ A runtime is a named accelerator preset stored in the project's `runtime.json`, so
132
+ "the GPU one" is something you name once instead of a set of flags you retype.
133
+
134
+ | Command | What it does |
135
+ |---|---|
136
+ | `runtime list` | Show every runtime configured for this notebook. |
137
+ | `runtime show` | Show which one is currently active. |
138
+ | `runtime use NAME` | Switch the active runtime for this notebook. |
139
+ | `runtime add NAME` | Add or overwrite one. `--label`, `--gpu`, `--tpu`, `--no-internet`, `--machine-shape` |
140
+ | `runtime remove NAME` | Remove a custom runtime. The built-in `default` cannot be removed. |
141
+
142
+ ### Datasets — `caudex dataset`
143
+
144
+ | Command | What it does |
145
+ |---|---|
146
+ | `dataset search QUERY` | Search Kaggle datasets. `--limit` |
147
+ | `dataset list` | Your Kaggle datasets, or local downloads with `--local`. |
148
+ | `dataset files OWNER/SLUG` | List files inside a dataset without downloading it. |
149
+ | `dataset pull OWNER/SLUG` | Download a dataset. `--dest`, `--no-unzip` |
150
+ | `dataset remove OWNER/SLUG` | Drop it from the local index. `--files` also deletes the files. |
151
+ | `dataset upload PATH` | Upload a local folder as a private dataset. `--name`, `--title`, `--update` |
152
+ | `dataset uploads` | Folders you have previously uploaded. |
153
+ | `dataset attach REF` | Attach a dataset to a kernel — it appears at `/kaggle/input/<slug>/`. `--no-verify` |
154
+ | `dataset detach REF` | Remove one from the kernel's `dataset_sources`. |
155
+ | `dataset sources` | What is currently attached. |
156
+
157
+ ### Paths — `caudex paths`
158
+
159
+ | Command | What it does |
160
+ |---|---|
161
+ | `paths show` | Current local path configuration. `--kernel REF` for one project's overrides. |
162
+ | `paths set KEY PATH` | Set `output_dir`, `datasets_dir` or `notebooks_dir`. `--kernel REF` scopes it to one kernel. |
163
+ | `paths unset KERNEL` | Drop per-kernel overrides. `--key` for just one. |
164
+ | `paths reset` | Restore the defaults. `--yes` to skip the confirmation. |
165
+
166
+ ### Other
167
+
168
+ | Command | What it does |
169
+ |---|---|
170
+ | `caudex convert SCRIPT` | Turn a plain `.py` script into a `.ipynb`. `--out` |
171
+
172
+ ---
173
+
174
+ ## Exit codes
175
+
176
+ Every command uses the same three. They exist so a CI script can tell the difference
177
+ between "your notebook is broken" and "we stopped watching a notebook that is fine".
178
+
179
+ | Code | Meaning |
180
+ |---|---|
181
+ | **0** | Success. The thing you asked for happened. |
182
+ | **1** | Failure, and we know it failed: the kernel errored, was cancelled, finished in any state that is not `complete`, or a precondition was not met (no credentials, no such runtime, unreadable metadata). |
183
+ | **2** | Usage error. Click rejected the command line — unknown command, missing argument, mutually exclusive flags. Nothing was written. |
184
+ | **124** | Timed out waiting. Same code `/usr/bin/timeout` uses, and it means the same thing here. |
185
+
186
+ **124 is not a failure.** It means we gave up watching, not that the run died. The kernel
187
+ is almost certainly still executing on Kaggle and still consuming your weekly quota. Either
188
+ go back to it with `caudex watch` / `caudex logs --follow`, or pass `--on-timeout cancel`
189
+ to have caudex ask Kaggle to stop the session when it gives up.
190
+
191
+ ```bash
192
+ caudex execute --dir ./exp --timeout 1800
193
+ case $? in
194
+ 0) echo "done" ;;
195
+ 124) echo "still running on Kaggle — check with: caudex status --dir ./exp" ;;
196
+ *) echo "failed — check with: caudex logs --dir ./exp" ;;
197
+ esac
198
+ ```
199
+
200
+ `caudex logs` is the one command that exits **0 for a failed kernel**. Reading the log of a
201
+ run that broke is the entire reason the command exists, so refusing to print it in exactly
202
+ that case would make it useless. It exits 1 only when the log itself could not be fetched.
203
+
204
+ ---
205
+
206
+ ## Where things live
207
+
208
+ | Path | |
209
+ |---|---|
210
+ | `~/.kaggle/kaggle.json` | Your Kaggle API token. The Kaggle SDK's own file — caudex reads and writes it but does not own it. |
211
+ | `%LOCALAPPDATA%\caudex\caudex\` | Config, session cache, dataset and upload indexes. `~/.config/caudex` on Linux, `~/Library/Application Support/caudex` on macOS. |
212
+ | `<project>/kernel-metadata.json` | The only file Kaggle ever sees besides the notebook. |
213
+ | `<project>/runtime.json` | Local accelerator presets. Never uploaded. |
214
+ | `<output_dir>/<owner>_<slug>/` | Where `pull` puts a run's outputs. `caudex paths show` prints the real path. |
215
+
216
+ `CAUDEX_CONFIG_DIR` and `CAUDEX_DATA_DIR` override the first two if you want a portable
217
+ install. Neither affects where migration looks for a 0.1.x profile.
218
+
219
+ ---
220
+
221
+ ## Breaking changes in 0.2.0
222
+
223
+ ### The rename
224
+
225
+ | 0.1.x | 0.2.0 |
226
+ |---|---|
227
+ | `kbr` | `caudex` |
228
+ | `import kaggle_bridge` | `import caudex` |
229
+ | `%LOCALAPPDATA%\kaggle-bridge\kaggle-bridge\` | `%LOCALAPPDATA%\caudex\caudex\` |
230
+ | `_kbr_progress.json` | `_caudex_progress.json` |
231
+
232
+ Nothing belonging to Kaggle was renamed. `KAGGLE_CONFIG_DIR`, `KAGGLE_USERNAME`,
233
+ `KAGGLE_KEY`, `~/.kaggle/kaggle.json`, `kernel-metadata.json`, `dataset-metadata.json`,
234
+ `/kaggle/working/` and `/kaggle/input/` all mean exactly what they meant before. Your
235
+ existing credentials keep working and you do not need to re-authenticate.
236
+
237
+ **Your config migrates itself** the first time you run `caudex`. `config.json`,
238
+ `session.json`, `datasets.json` and `local_uploads.json` are copied over, each validated as
239
+ JSON first and skipped individually if corrupt, never overwriting a file that already
240
+ exists. The originals are left completely untouched, so a 0.1.x install alongside keeps
241
+ working. If you never ran `kbr paths set`, your outputs are sitting under the old data
242
+ directory — migration writes an explicit `config.json` pinning the three directories there,
243
+ rather than letting the new defaults silently point you at an empty folder.
244
+
245
+ Both installs on `PATH` at once will confuse nothing except you. Uninstall kaggle-bridge.
246
+
247
+ ### Exit codes changed
248
+
249
+ Read this section if anything you own scripts against caudex.
250
+
251
+ - **A timeout now exits 124, not 1.** In 0.1.x, "the notebook failed" and "we stopped
252
+ waiting" were the same exit code, so no script could tell them apart, and the usual
253
+ reaction — treat non-zero as failure and move on — abandoned a kernel that was still
254
+ burning quota. See the table above.
255
+ - **A run that ends in any state other than `complete` now exits 1.** 0.1.x checked for
256
+ `error` and `timeout` explicitly and let everything else fall through to success. A
257
+ cancelled kernel therefore made `kbr watch` **print nothing at all and exit 0**. Now
258
+ `cancelled`, `cancelAcknowledged`, `cancelling`, a still-`running` kernel, and any state
259
+ this build has never heard of all exit 1 with a message saying which one it was.
260
+ - The decision is made in one place for `watch`, `run` and `execute`, so they can no longer
261
+ disagree about whether the same kernel succeeded.
262
+
263
+ ### Renamed commands and flags
264
+
265
+ All four old spellings still work. Each one runs the new behaviour, prints a deprecation
266
+ notice **on stderr**, and is absent from `--help`, so stdout stays parseable and nobody new
267
+ learns the old name from us.
268
+
269
+ | Old | New | Why |
270
+ |---|---|---|
271
+ | `kbr list` | `caudex notebooks` | `list` never said what it listed. |
272
+ | `kbr run` | `caudex execute` | `execute` is the same pipeline with log streaming and the cell report switched on. `run` survives as the quiet variant. |
273
+ | `pull --notebook` | `pull --pull-notebook` | `execute` takes `NOTEBOOK` as a positional meaning "the notebook to run", so a `--notebook` flag meaning "download one" could not be read the same way twice. |
274
+ | `execute --save-to` | `execute --output-dir` | Two names for one destination, and `pull` already called it `--output-dir`. |
275
+
276
+ `caudex run` is kept deliberately unchanged, not just aliased: it still injects no tracker
277
+ cell, so your `.ipynb` is byte-identical afterwards, and it still streams no logs and prints
278
+ no cell report. Existing scripts behave exactly as they did.
279
+
280
+ ### Output that moved
281
+
282
+ - **`init` and `watch` now print the directory files actually land in.** Both used to print
283
+ `output_dir` while `pull` wrote into `output_dir/<owner>_<slug>`, so the path on screen
284
+ was never the path on disk.
285
+ - **Errors go to stderr under `rich`.** With `rich` installed, 0.1.x printed error messages
286
+ to stdout, so `kbr logs > run.txt` captured its own error text into the log file. The
287
+ plain-text fallback always got this right; now both do.
288
+ - **`caudex logs` puts log content on stdout and nothing else.** "Log written to …",
289
+ "No logs available yet" and every other notice go to stderr, so `caudex logs > run.txt`
290
+ produces a log file rather than a log file with a progress report in it.
291
+ - **Runtime drift is now reported.** When `kernel-metadata.json` disagrees with the active
292
+ runtime, the runtime still wins — but 0.1.x said nothing at all while overwriting your
293
+ metadata, which is how a notebook could quietly run on CPU after you had set
294
+ `enable_gpu: true` by hand. caudex names the keys it changed. The message is suppressed
295
+ when you named a runtime explicitly, because `--gpu` *is* you resolving the disagreement.
296
+ - **Nested output files are listed distinctly.** `a/scores.csv` and `b/scores.csv` used to
297
+ collapse onto the same line.
298
+
299
+ ### New
300
+
301
+ - **`caudex logs`** — read a run's log after the fact, or `--follow` it live. The API call
302
+ had been fully implemented since 0.1.0 with no command wired to it, so there was no
303
+ supported way to read a kernel's output once the run was over.
304
+ - **`--on-timeout {warn,cancel}`** on `watch`, `run` and `execute`. `warn` is the default
305
+ and matches 0.1.x. `cancel` asks Kaggle to stop the session so it stops using quota.
306
+ - **`--gpu/--no-gpu`** on `execute` and `run` as shorthand for `--runtime gpu` /
307
+ `--runtime default`, for this run only — it does not change the project's active runtime.
308
+ Combining it with an explicit `--runtime` is a usage error (exit 2), rejected before
309
+ anything is written to disk.
310
+
311
+ ---
312
+
313
+ ## Development
314
+
315
+ ```bash
316
+ pip install -e ".[dev]"
317
+ python -m pytest
318
+ ```
319
+
320
+ Building the Windows binary and installer needs PyInstaller plus
321
+ [Inno Setup 6](https://jrsoftware.org/isdl.php):
322
+
323
+ ```powershell
324
+ .\build.ps1 # dist\caudex.exe + dist\caudex-0.2.0-windows-x64-setup.exe
325
+ .\build.ps1 -SkipInstaller # just the .exe
326
+ ```
327
+
328
+ `build/caudex.spec` collects data files out of whichever environment PyInstaller runs in,
329
+ so build from the same environment the app runs in, with the Jupyter stack installed. The
330
+ spec filters the build machine's live Jupyter state (`share/jupyter/runtime/`,
331
+ `notebook_secret`, `nbsignatures.db`) out of the bundle — 0.1.0 shipped all of it to every
332
+ user, and that must not happen again.
333
+
334
+ ---
335
+
336
+ ## Licence
337
+
338
+ Apache-2.0. The full text ships in every release as `LICENSE`, and inside the installed
339
+ package at `caudex-<version>.dist-info/licenses/LICENSE`.