runloop-api-client 0.1.0a3__tar.gz → 0.1.0a5__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 (106) hide show
  1. {runloop_api_client-0.1.0a3 → runloop_api_client-0.1.0a5}/.gitignore +1 -0
  2. runloop_api_client-0.1.0a5/.release-please-manifest.json +3 -0
  3. runloop_api_client-0.1.0a5/CHANGELOG.md +58 -0
  4. runloop_api_client-0.1.0a5/CONTRIBUTING.md +125 -0
  5. {runloop_api_client-0.1.0a3 → runloop_api_client-0.1.0a5}/PKG-INFO +20 -20
  6. runloop_api_client-0.1.0a5/README.md +300 -0
  7. runloop_api_client-0.1.0a5/SECURITY.md +27 -0
  8. runloop_api_client-0.1.0a5/api.md +79 -0
  9. runloop_api_client-0.1.0a5/bin/check-release-environment +32 -0
  10. runloop_api_client-0.1.0a5/bin/publish-pypi +9 -0
  11. runloop_api_client-0.1.0a5/examples/.keep +4 -0
  12. runloop_api_client-0.1.0a5/mypy.ini +47 -0
  13. runloop_api_client-0.1.0a5/noxfile.py +9 -0
  14. {runloop_api_client-0.1.0a3 → runloop_api_client-0.1.0a5}/pyproject.toml +21 -5
  15. runloop_api_client-0.1.0a5/release-please-config.json +66 -0
  16. runloop_api_client-0.1.0a5/requirements-dev.lock +104 -0
  17. runloop_api_client-0.1.0a5/requirements.lock +44 -0
  18. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/__init__.py +2 -2
  19. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_base_client.py +19 -3
  20. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_client.py +2 -2
  21. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_models.py +27 -0
  22. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_response.py +4 -4
  23. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_types.py +1 -1
  24. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_utils/__init__.py +4 -1
  25. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_utils/_logs.py +2 -2
  26. runloop_api_client-0.1.0a5/src/runloop_api_client/_utils/_reflection.py +42 -0
  27. runloop_api_client-0.1.0a5/src/runloop_api_client/_version.py +4 -0
  28. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/resources/devboxes/devboxes.py +17 -1
  29. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/resources/functions/invocations/__init__.py +0 -14
  30. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/resources/functions/invocations/invocations.py +0 -32
  31. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/__init__.py +1 -0
  32. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/devbox_create_params.py +3 -0
  33. runloop_api_client-0.1.0a5/src/runloop_api_client/types/devbox_execute_sync_params.py +12 -0
  34. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/devbox_view.py +3 -0
  35. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/devboxes/devbox_logs_list_view.py +13 -0
  36. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client/types/functions/invocations → runloop_api_client-0.1.0a5/src/runloop_api_client/types/projects}/__init__.py +0 -2
  37. runloop_api_client-0.1.0a5/tests/__init__.py +1 -0
  38. runloop_api_client-0.1.0a5/tests/api_resources/__init__.py +1 -0
  39. runloop_api_client-0.1.0a5/tests/api_resources/devboxes/__init__.py +1 -0
  40. runloop_api_client-0.1.0a5/tests/api_resources/devboxes/test_logs.py +98 -0
  41. runloop_api_client-0.1.0a5/tests/api_resources/functions/__init__.py +1 -0
  42. runloop_api_client-0.1.0a5/tests/api_resources/functions/invocations/__init__.py +1 -0
  43. runloop_api_client-0.1.0a5/tests/api_resources/functions/test_invocations.py +225 -0
  44. runloop_api_client-0.1.0a5/tests/api_resources/projects/__init__.py +1 -0
  45. runloop_api_client-0.1.0a5/tests/api_resources/projects/test_logs.py +98 -0
  46. runloop_api_client-0.1.0a5/tests/api_resources/test_devboxes.py +406 -0
  47. runloop_api_client-0.1.0a5/tests/api_resources/test_functions.py +325 -0
  48. runloop_api_client-0.1.0a5/tests/api_resources/test_projects.py +72 -0
  49. runloop_api_client-0.1.0a5/tests/conftest.py +49 -0
  50. runloop_api_client-0.1.0a5/tests/sample_file.txt +1 -0
  51. runloop_api_client-0.1.0a5/tests/test_client.py +1475 -0
  52. runloop_api_client-0.1.0a5/tests/test_deepcopy.py +59 -0
  53. runloop_api_client-0.1.0a5/tests/test_extract_files.py +64 -0
  54. runloop_api_client-0.1.0a5/tests/test_files.py +51 -0
  55. runloop_api_client-0.1.0a5/tests/test_models.py +829 -0
  56. runloop_api_client-0.1.0a5/tests/test_qs.py +78 -0
  57. runloop_api_client-0.1.0a5/tests/test_required_args.py +111 -0
  58. runloop_api_client-0.1.0a5/tests/test_response.py +194 -0
  59. runloop_api_client-0.1.0a5/tests/test_streaming.py +248 -0
  60. runloop_api_client-0.1.0a5/tests/test_transform.py +410 -0
  61. runloop_api_client-0.1.0a5/tests/test_utils/test_proxy.py +23 -0
  62. runloop_api_client-0.1.0a5/tests/test_utils/test_typing.py +78 -0
  63. runloop_api_client-0.1.0a5/tests/utils.py +151 -0
  64. runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client/_utils/_reflection.py +0 -8
  65. runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client/_version.py +0 -4
  66. runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client/resources/functions/invocations/spans.py +0 -147
  67. runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client/types/functions/invocations/invocation_span_list_view.py +0 -16
  68. {runloop_api_client-0.1.0a3 → runloop_api_client-0.1.0a5}/LICENSE +0 -0
  69. {runloop_api_client-0.1.0a3 → runloop_api_client-0.1.0a5}/src/runloop/lib/.keep +0 -0
  70. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_compat.py +0 -0
  71. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_constants.py +0 -0
  72. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_exceptions.py +0 -0
  73. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_files.py +0 -0
  74. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_qs.py +0 -0
  75. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_resource.py +0 -0
  76. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_streaming.py +0 -0
  77. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_utils/_proxy.py +0 -0
  78. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_utils/_streams.py +0 -0
  79. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_utils/_sync.py +0 -0
  80. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_utils/_transform.py +0 -0
  81. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_utils/_typing.py +0 -0
  82. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/_utils/_utils.py +0 -0
  83. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/lib/.keep +0 -0
  84. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/py.typed +0 -0
  85. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/resources/__init__.py +0 -0
  86. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/resources/devboxes/__init__.py +0 -0
  87. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/resources/devboxes/logs.py +0 -0
  88. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/resources/functions/__init__.py +0 -0
  89. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/resources/functions/functions.py +0 -0
  90. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/resources/projects/__init__.py +0 -0
  91. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/resources/projects/logs.py +0 -0
  92. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/resources/projects/projects.py +0 -0
  93. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/devbox_execution_detail_view.py +0 -0
  94. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/devbox_list_params.py +0 -0
  95. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/devbox_list_view.py +0 -0
  96. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/devboxes/__init__.py +0 -0
  97. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/function_invoke_async_params.py +0 -0
  98. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/function_invoke_sync_params.py +0 -0
  99. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/function_list_view.py +0 -0
  100. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/functions/__init__.py +0 -0
  101. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/functions/function_invocation_list_view.py +0 -0
  102. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client/types/projects → runloop_api_client-0.1.0a5/src/runloop_api_client/types/functions/invocations}/__init__.py +0 -0
  103. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/project_list_view.py +0 -0
  104. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/shared/__init__.py +0 -0
  105. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/shared/function_invocation_detail_view.py +0 -0
  106. {runloop_api_client-0.1.0a3/src/runloop_minus_api_minus_client → runloop_api_client-0.1.0a5/src/runloop_api_client}/types/shared/project_logs_view.py +0 -0
@@ -1,3 +1,4 @@
1
+ .prism.log
1
2
  .vscode
2
3
  _dev
3
4
 
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.1.0-alpha.5"
3
+ }
@@ -0,0 +1,58 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0-alpha.5 (2024-07-03)
4
+
5
+ Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/runloopai/api-client-python/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)
6
+
7
+ ### Features
8
+
9
+ * **api:** OpenAPI spec update via Stainless API ([#19](https://github.com/runloopai/api-client-python/issues/19)) ([9def751](https://github.com/runloopai/api-client-python/commit/9def7518972cdb0c0a03728408d8e10f79090ba5))
10
+ * **api:** OpenAPI spec update via Stainless API ([#20](https://github.com/runloopai/api-client-python/issues/20)) ([a0bf266](https://github.com/runloopai/api-client-python/commit/a0bf2667f1831d91cc1375328f355dc561b98a37))
11
+ * **api:** OpenAPI spec update via Stainless API ([#21](https://github.com/runloopai/api-client-python/issues/21)) ([9e9f3c2](https://github.com/runloopai/api-client-python/commit/9e9f3c2150928658c49e5c18569411766be60bbe))
12
+ * **api:** OpenAPI spec update via Stainless API ([#22](https://github.com/runloopai/api-client-python/issues/22)) ([5bf8bc0](https://github.com/runloopai/api-client-python/commit/5bf8bc0c5030ed78d04b7a513a0d167aa3e9acf8))
13
+
14
+ ## 0.1.0-alpha.4 (2024-06-26)
15
+
16
+ Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/runloopai/api-client-python/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
17
+
18
+ ### Features
19
+
20
+ * **api:** update via SDK Studio ([#15](https://github.com/runloopai/api-client-python/issues/15)) ([4813de5](https://github.com/runloopai/api-client-python/commit/4813de5f1d73df3e39a4efff76d7d80202e65162))
21
+
22
+ ## 0.1.0-alpha.3 (2024-06-26)
23
+
24
+ Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/runloopai/api-client-python/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
25
+
26
+ ### Features
27
+
28
+ * **api:** update via SDK Studio ([#12](https://github.com/runloopai/api-client-python/issues/12)) ([a86d706](https://github.com/runloopai/api-client-python/commit/a86d7069570b8d0360d3e67b90ee1fed736ec1df))
29
+
30
+ ## 0.1.0-alpha.2 (2024-06-25)
31
+
32
+ Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/runloopai/api-client-python/compare/v0.1.0-alpha.1...v0.1.0-alpha.2)
33
+
34
+ ### Features
35
+
36
+ * **api:** update via SDK Studio ([#9](https://github.com/runloopai/api-client-python/issues/9)) ([9a53399](https://github.com/runloopai/api-client-python/commit/9a533998e9f44bf77fc0697c32af441ab1ec49fc))
37
+
38
+ ## 0.1.0-alpha.1 (2024-06-25)
39
+
40
+ Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/runloopai/api-client-python/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)
41
+
42
+ ### Features
43
+
44
+ * **api:** OpenAPI spec update via Stainless API ([17991ec](https://github.com/runloopai/api-client-python/commit/17991ec2bd449f7ffef39a9da4b274f82c61c364))
45
+ * **api:** OpenAPI spec update via Stainless API ([a624924](https://github.com/runloopai/api-client-python/commit/a62492427ea762b1fa8e6e438ba489ff08b798e5))
46
+ * **api:** OpenAPI spec update via Stainless API ([#4](https://github.com/runloopai/api-client-python/issues/4)) ([134f28f](https://github.com/runloopai/api-client-python/commit/134f28ff63f25f18d3a4b7e2300b768ffa4c7590))
47
+ * **api:** update via SDK Studio ([88939b3](https://github.com/runloopai/api-client-python/commit/88939b3e46af521bc43a7b25e66ddb5a553a2af6))
48
+ * **api:** update via SDK Studio ([e2cca37](https://github.com/runloopai/api-client-python/commit/e2cca3796d1a2b128abb6f93b8e444f0dd4da501))
49
+
50
+
51
+ ### Chores
52
+
53
+ * go live ([#2](https://github.com/runloopai/api-client-python/issues/2)) ([3ae4996](https://github.com/runloopai/api-client-python/commit/3ae4996b2474aabb19a98cf38b834ca3e91d7c2b))
54
+ * go live ([#5](https://github.com/runloopai/api-client-python/issues/5)) ([626be20](https://github.com/runloopai/api-client-python/commit/626be201c2ed40ac34f2b5869f6c17c431ee543b))
55
+ * update SDK settings ([ac8358a](https://github.com/runloopai/api-client-python/commit/ac8358ae8d3ac7ba5bab2082384ae5029c50fcc8))
56
+ * update SDK settings ([#3](https://github.com/runloopai/api-client-python/issues/3)) ([ef88178](https://github.com/runloopai/api-client-python/commit/ef88178299ae3988bc3d1e813c462d609312f69a))
57
+ * update SDK settings ([#6](https://github.com/runloopai/api-client-python/issues/6)) ([82a6f56](https://github.com/runloopai/api-client-python/commit/82a6f56061cd0ebfa88ed3ec71d044a0fb131f0a))
58
+ * update SDK settings ([#7](https://github.com/runloopai/api-client-python/issues/7)) ([aa9d69b](https://github.com/runloopai/api-client-python/commit/aa9d69b15a011dfa8381ec08327c88e5c2a1ab8d))
@@ -0,0 +1,125 @@
1
+ ## Setting up the environment
2
+
3
+ ### With Rye
4
+
5
+ We use [Rye](https://rye.astral.sh/) to manage dependencies so we highly recommend [installing it](https://rye.astral.sh/guide/installation/) as it will automatically provision a Python environment with the expected Python version.
6
+
7
+ After installing Rye, you'll just have to run this command:
8
+
9
+ ```sh
10
+ $ rye sync --all-features
11
+ ```
12
+
13
+ You can then run scripts using `rye run python script.py` or by activating the virtual environment:
14
+
15
+ ```sh
16
+ $ rye shell
17
+ # or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
18
+ $ source .venv/bin/activate
19
+
20
+ # now you can omit the `rye run` prefix
21
+ $ python script.py
22
+ ```
23
+
24
+ ### Without Rye
25
+
26
+ Alternatively if you don't want to install `Rye`, you can stick with the standard `pip` setup by ensuring you have the Python version specified in `.python-version`, create a virtual environment however you desire and then install dependencies using this command:
27
+
28
+ ```sh
29
+ $ pip install -r requirements-dev.lock
30
+ ```
31
+
32
+ ## Modifying/Adding code
33
+
34
+ Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
35
+ `src/runloop_api_client/lib/` and `examples/` directories are exceptions and will never be overridden.
36
+
37
+ ## Adding and running examples
38
+
39
+ All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or
40
+ added to.
41
+
42
+ ```bash
43
+ # add an example to examples/<your-example>.py
44
+
45
+ #!/usr/bin/env -S rye run python
46
+ …
47
+ ```
48
+
49
+ ```
50
+ chmod +x examples/<your-example>.py
51
+ # run the example against your api
52
+ ./examples/<your-example>.py
53
+ ```
54
+
55
+ ## Using the repository from source
56
+
57
+ If you’d like to use the repository from source, you can either install from git or link to a cloned repository:
58
+
59
+ To install via git:
60
+
61
+ ```bash
62
+ pip install git+ssh://git@github.com/runloopai/api-client-python.git
63
+ ```
64
+
65
+ Alternatively, you can build from source and install the wheel file:
66
+
67
+ Building this package will create two files in the `dist/` directory, a `.tar.gz` containing the source files and a `.whl` that can be used to install the package efficiently.
68
+
69
+ To create a distributable version of the library, all you have to do is run this command:
70
+
71
+ ```bash
72
+ rye build
73
+ # or
74
+ python -m build
75
+ ```
76
+
77
+ Then to install:
78
+
79
+ ```sh
80
+ pip install ./path-to-wheel-file.whl
81
+ ```
82
+
83
+ ## Running tests
84
+
85
+ Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
86
+
87
+ ```bash
88
+ # you will need npm installed
89
+ npx prism mock path/to/your/openapi.yml
90
+ ```
91
+
92
+ ```bash
93
+ rye run pytest
94
+ ```
95
+
96
+ ## Linting and formatting
97
+
98
+ This repository uses [ruff](https://github.com/astral-sh/ruff) and
99
+ [black](https://github.com/psf/black) to format the code in the repository.
100
+
101
+ To lint:
102
+
103
+ ```bash
104
+ rye run lint
105
+ ```
106
+
107
+ To format and fix all ruff issues automatically:
108
+
109
+ ```bash
110
+ rye run format
111
+ ```
112
+
113
+ ## Publishing and releases
114
+
115
+ Changes made to this repository via the automated release PR pipeline should publish to PyPI automatically. If
116
+ the changes aren't made through the automated pipeline, you may want to make releases manually.
117
+
118
+ ### Publish with a GitHub workflow
119
+
120
+ You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/runloopai/api-client-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
121
+
122
+ ### Publish manually
123
+
124
+ If you need to manually release a package, you can run the `bin/publish-pypi` script with a `PYPI_TOKEN` set on
125
+ the environment.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
- Name: runloop-api-client
3
- Version: 0.1.0a3
2
+ Name: runloop_api_client
3
+ Version: 0.1.0a5
4
4
  Summary: The official Python library for the runloop API
5
5
  Project-URL: Homepage, https://github.com/runloopai/api-client-python
6
6
  Project-URL: Repository, https://github.com/runloopai/api-client-python
@@ -34,7 +34,7 @@ Description-Content-Type: text/markdown
34
34
 
35
35
  # Runloop Python API library
36
36
 
37
- [![PyPI version](https://img.shields.io/pypi/v/runloop-api-client.svg)](https://pypi.org/project/runloop-api-client/)
37
+ [![PyPI version](https://img.shields.io/pypi/v/runloop_api_client.svg)](https://pypi.org/project/runloop_api_client/)
38
38
 
39
39
  The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.7+
40
40
  application. The library includes type definitions for all request params and response fields,
@@ -50,7 +50,7 @@ The REST API documentation can be found [on runloop.ai](https://runloop.ai). The
50
50
 
51
51
  ```sh
52
52
  # install from PyPI
53
- pip install --pre runloop-api-client
53
+ pip install --pre runloop_api_client
54
54
  ```
55
55
 
56
56
  ## Usage
@@ -59,7 +59,7 @@ The full API of this library can be found in [api.md](https://github.com/runloop
59
59
 
60
60
  ```python
61
61
  import os
62
- from runloop_minus_api_minus_client import Runloop
62
+ from runloop_api_client import Runloop
63
63
 
64
64
  client = Runloop(
65
65
  # This is the default and can be omitted
@@ -82,7 +82,7 @@ Simply import `AsyncRunloop` instead of `Runloop` and use `await` with each API
82
82
  ```python
83
83
  import os
84
84
  import asyncio
85
- from runloop_minus_api_minus_client import AsyncRunloop
85
+ from runloop_api_client import AsyncRunloop
86
86
 
87
87
  client = AsyncRunloop(
88
88
  # This is the default and can be omitted
@@ -111,27 +111,27 @@ Typed requests and responses provide autocomplete and documentation within your
111
111
 
112
112
  ## Handling errors
113
113
 
114
- When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop_minus_api_minus_client.APIConnectionError` is raised.
114
+ When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop_api_client.APIConnectionError` is raised.
115
115
 
116
116
  When the API returns a non-success status code (that is, 4xx or 5xx
117
- response), a subclass of `runloop_minus_api_minus_client.APIStatusError` is raised, containing `status_code` and `response` properties.
117
+ response), a subclass of `runloop_api_client.APIStatusError` is raised, containing `status_code` and `response` properties.
118
118
 
119
- All errors inherit from `runloop_minus_api_minus_client.APIError`.
119
+ All errors inherit from `runloop_api_client.APIError`.
120
120
 
121
121
  ```python
122
- import runloop_minus_api_minus_client
123
- from runloop_minus_api_minus_client import Runloop
122
+ import runloop_api_client
123
+ from runloop_api_client import Runloop
124
124
 
125
125
  client = Runloop()
126
126
 
127
127
  try:
128
128
  client.devboxes.create()
129
- except runloop_minus_api_minus_client.APIConnectionError as e:
129
+ except runloop_api_client.APIConnectionError as e:
130
130
  print("The server could not be reached")
131
131
  print(e.__cause__) # an underlying Exception, likely raised within httpx.
132
- except runloop_minus_api_minus_client.RateLimitError as e:
132
+ except runloop_api_client.RateLimitError as e:
133
133
  print("A 429 status code was received; we should back off a bit.")
134
- except runloop_minus_api_minus_client.APIStatusError as e:
134
+ except runloop_api_client.APIStatusError as e:
135
135
  print("Another non-200-range status code was received")
136
136
  print(e.status_code)
137
137
  print(e.response)
@@ -159,7 +159,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
159
159
  You can use the `max_retries` option to configure or disable retry settings:
160
160
 
161
161
  ```python
162
- from runloop_minus_api_minus_client import Runloop
162
+ from runloop_api_client import Runloop
163
163
 
164
164
  # Configure the default for all requests:
165
165
  client = Runloop(
@@ -177,7 +177,7 @@ By default requests time out after 1 minute. You can configure this with a `time
177
177
  which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
178
178
 
179
179
  ```python
180
- from runloop_minus_api_minus_client import Runloop
180
+ from runloop_api_client import Runloop
181
181
 
182
182
  # Configure the default for all requests:
183
183
  client = Runloop(
@@ -227,7 +227,7 @@ if response.my_field is None:
227
227
  The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
228
228
 
229
229
  ```py
230
- from runloop_minus_api_minus_client import Runloop
230
+ from runloop_api_client import Runloop
231
231
 
232
232
  client = Runloop()
233
233
  response = client.devboxes.with_raw_response.create()
@@ -237,9 +237,9 @@ devbox = response.parse() # get the object that `devboxes.create()` would have
237
237
  print(devbox.id)
238
238
  ```
239
239
 
240
- These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_minus_api_minus_client/_response.py) object.
240
+ These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object.
241
241
 
242
- The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_minus_api_minus_client/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
242
+ The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
243
243
 
244
244
  #### `.with_streaming_response`
245
245
 
@@ -301,7 +301,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
301
301
  - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality
302
302
 
303
303
  ```python
304
- from runloop_minus_api_minus_client import Runloop, DefaultHttpxClient
304
+ from runloop_api_client import Runloop, DefaultHttpxClient
305
305
 
306
306
  client = Runloop(
307
307
  # Or use the `RUNLOOP_BASE_URL` env var
@@ -0,0 +1,300 @@
1
+ # Runloop Python API library
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/runloop_api_client.svg)](https://pypi.org/project/runloop_api_client/)
4
+
5
+ The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.7+
6
+ application. The library includes type definitions for all request params and response fields,
7
+ and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).
8
+
9
+ It is generated with [Stainless](https://www.stainlessapi.com/).
10
+
11
+ ## Documentation
12
+
13
+ The REST API documentation can be found [on runloop.ai](https://runloop.ai). The full API of this library can be found in [api.md](api.md).
14
+
15
+ ## Installation
16
+
17
+ ```sh
18
+ # install from PyPI
19
+ pip install --pre runloop_api_client
20
+ ```
21
+
22
+ ## Usage
23
+
24
+ The full API of this library can be found in [api.md](api.md).
25
+
26
+ ```python
27
+ import os
28
+ from runloop_api_client import Runloop
29
+
30
+ client = Runloop(
31
+ # This is the default and can be omitted
32
+ bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"),
33
+ )
34
+
35
+ devbox_view = client.devboxes.create()
36
+ print(devbox_view.id)
37
+ ```
38
+
39
+ While you can provide a `bearer_token` keyword argument,
40
+ we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
41
+ to add `RUNLOOP_BEARER_TOKEN="My Bearer Token"` to your `.env` file
42
+ so that your Bearer Token is not stored in source control.
43
+
44
+ ## Async usage
45
+
46
+ Simply import `AsyncRunloop` instead of `Runloop` and use `await` with each API call:
47
+
48
+ ```python
49
+ import os
50
+ import asyncio
51
+ from runloop_api_client import AsyncRunloop
52
+
53
+ client = AsyncRunloop(
54
+ # This is the default and can be omitted
55
+ bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"),
56
+ )
57
+
58
+
59
+ async def main() -> None:
60
+ devbox_view = await client.devboxes.create()
61
+ print(devbox_view.id)
62
+
63
+
64
+ asyncio.run(main())
65
+ ```
66
+
67
+ Functionality between the synchronous and asynchronous clients is otherwise identical.
68
+
69
+ ## Using types
70
+
71
+ Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:
72
+
73
+ - Serializing back into JSON, `model.to_json()`
74
+ - Converting to a dictionary, `model.to_dict()`
75
+
76
+ Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.
77
+
78
+ ## Handling errors
79
+
80
+ When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop_api_client.APIConnectionError` is raised.
81
+
82
+ When the API returns a non-success status code (that is, 4xx or 5xx
83
+ response), a subclass of `runloop_api_client.APIStatusError` is raised, containing `status_code` and `response` properties.
84
+
85
+ All errors inherit from `runloop_api_client.APIError`.
86
+
87
+ ```python
88
+ import runloop_api_client
89
+ from runloop_api_client import Runloop
90
+
91
+ client = Runloop()
92
+
93
+ try:
94
+ client.devboxes.create()
95
+ except runloop_api_client.APIConnectionError as e:
96
+ print("The server could not be reached")
97
+ print(e.__cause__) # an underlying Exception, likely raised within httpx.
98
+ except runloop_api_client.RateLimitError as e:
99
+ print("A 429 status code was received; we should back off a bit.")
100
+ except runloop_api_client.APIStatusError as e:
101
+ print("Another non-200-range status code was received")
102
+ print(e.status_code)
103
+ print(e.response)
104
+ ```
105
+
106
+ Error codes are as followed:
107
+
108
+ | Status Code | Error Type |
109
+ | ----------- | -------------------------- |
110
+ | 400 | `BadRequestError` |
111
+ | 401 | `AuthenticationError` |
112
+ | 403 | `PermissionDeniedError` |
113
+ | 404 | `NotFoundError` |
114
+ | 422 | `UnprocessableEntityError` |
115
+ | 429 | `RateLimitError` |
116
+ | >=500 | `InternalServerError` |
117
+ | N/A | `APIConnectionError` |
118
+
119
+ ### Retries
120
+
121
+ Certain errors are automatically retried 2 times by default, with a short exponential backoff.
122
+ Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
123
+ 429 Rate Limit, and >=500 Internal errors are all retried by default.
124
+
125
+ You can use the `max_retries` option to configure or disable retry settings:
126
+
127
+ ```python
128
+ from runloop_api_client import Runloop
129
+
130
+ # Configure the default for all requests:
131
+ client = Runloop(
132
+ # default is 2
133
+ max_retries=0,
134
+ )
135
+
136
+ # Or, configure per-request:
137
+ client.with_options(max_retries=5).devboxes.create()
138
+ ```
139
+
140
+ ### Timeouts
141
+
142
+ By default requests time out after 1 minute. You can configure this with a `timeout` option,
143
+ which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
144
+
145
+ ```python
146
+ from runloop_api_client import Runloop
147
+
148
+ # Configure the default for all requests:
149
+ client = Runloop(
150
+ # 20 seconds (default is 1 minute)
151
+ timeout=20.0,
152
+ )
153
+
154
+ # More granular control:
155
+ client = Runloop(
156
+ timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
157
+ )
158
+
159
+ # Override per-request:
160
+ client.with_options(timeout=5.0).devboxes.create()
161
+ ```
162
+
163
+ On timeout, an `APITimeoutError` is thrown.
164
+
165
+ Note that requests that time out are [retried twice by default](#retries).
166
+
167
+ ## Advanced
168
+
169
+ ### Logging
170
+
171
+ We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.
172
+
173
+ You can enable logging by setting the environment variable `RUNLOOP_LOG` to `debug`.
174
+
175
+ ```shell
176
+ $ export RUNLOOP_LOG=debug
177
+ ```
178
+
179
+ ### How to tell whether `None` means `null` or missing
180
+
181
+ In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:
182
+
183
+ ```py
184
+ if response.my_field is None:
185
+ if 'my_field' not in response.model_fields_set:
186
+ print('Got json like {}, without a "my_field" key present at all.')
187
+ else:
188
+ print('Got json like {"my_field": null}.')
189
+ ```
190
+
191
+ ### Accessing raw response data (e.g. headers)
192
+
193
+ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
194
+
195
+ ```py
196
+ from runloop_api_client import Runloop
197
+
198
+ client = Runloop()
199
+ response = client.devboxes.with_raw_response.create()
200
+ print(response.headers.get('X-My-Header'))
201
+
202
+ devbox = response.parse() # get the object that `devboxes.create()` would have returned
203
+ print(devbox.id)
204
+ ```
205
+
206
+ These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object.
207
+
208
+ The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
209
+
210
+ #### `.with_streaming_response`
211
+
212
+ The above interface eagerly reads the full response body when you make the request, which may not always be what you want.
213
+
214
+ To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
215
+
216
+ ```python
217
+ with client.devboxes.with_streaming_response.create() as response:
218
+ print(response.headers.get("X-My-Header"))
219
+
220
+ for line in response.iter_lines():
221
+ print(line)
222
+ ```
223
+
224
+ The context manager is required so that the response will reliably be closed.
225
+
226
+ ### Making custom/undocumented requests
227
+
228
+ This library is typed for convenient access to the documented API.
229
+
230
+ If you need to access undocumented endpoints, params, or response properties, the library can still be used.
231
+
232
+ #### Undocumented endpoints
233
+
234
+ To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
235
+ http verbs. Options on the client will be respected (such as retries) will be respected when making this
236
+ request.
237
+
238
+ ```py
239
+ import httpx
240
+
241
+ response = client.post(
242
+ "/foo",
243
+ cast_to=httpx.Response,
244
+ body={"my_param": True},
245
+ )
246
+
247
+ print(response.headers.get("x-foo"))
248
+ ```
249
+
250
+ #### Undocumented request params
251
+
252
+ If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
253
+ options.
254
+
255
+ #### Undocumented response properties
256
+
257
+ To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
258
+ can also get all the extra fields on the Pydantic model as a dict with
259
+ [`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).
260
+
261
+ ### Configuring the HTTP client
262
+
263
+ You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:
264
+
265
+ - Support for proxies
266
+ - Custom transports
267
+ - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality
268
+
269
+ ```python
270
+ from runloop_api_client import Runloop, DefaultHttpxClient
271
+
272
+ client = Runloop(
273
+ # Or use the `RUNLOOP_BASE_URL` env var
274
+ base_url="http://my.test.server.example.com:8083",
275
+ http_client=DefaultHttpxClient(
276
+ proxies="http://my.test.proxy.example.com",
277
+ transport=httpx.HTTPTransport(local_address="0.0.0.0"),
278
+ ),
279
+ )
280
+ ```
281
+
282
+ ### Managing HTTP resources
283
+
284
+ By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
285
+
286
+ ## Versioning
287
+
288
+ This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
289
+
290
+ 1. Changes that only affect static types, without breaking runtime behavior.
291
+ 2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
292
+ 3. Changes that we do not expect to impact the vast majority of users in practice.
293
+
294
+ We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
295
+
296
+ We are keen for your feedback; please open an [issue](https://www.github.com/runloopai/api-client-python/issues) with questions, bugs, or suggestions.
297
+
298
+ ## Requirements
299
+
300
+ Python 3.7 or higher.
@@ -0,0 +1,27 @@
1
+ # Security Policy
2
+
3
+ ## Reporting Security Issues
4
+
5
+ This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken.
6
+
7
+ To report a security issue, please contact the Stainless team at security@stainlessapi.com.
8
+
9
+ ## Responsible Disclosure
10
+
11
+ We appreciate the efforts of security researchers and individuals who help us maintain the security of
12
+ SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible
13
+ disclosure practices by allowing us a reasonable amount of time to investigate and address the issue
14
+ before making any information public.
15
+
16
+ ## Reporting Non-SDK Related Security Issues
17
+
18
+ If you encounter security issues that are not directly related to SDKs but pertain to the services
19
+ or products provided by Runloop please follow the respective company's security reporting guidelines.
20
+
21
+ ### Runloop Terms and Policies
22
+
23
+ Please contact support@runloop.ai for any questions or concerns regarding security of our services.
24
+
25
+ ---
26
+
27
+ Thank you for helping us keep the SDKs and systems they interact with secure.