Skip to content

Commit a54194f

Browse files
authored
Merge pull request #18 from runloopai/release-please--branches--main--changes--next
release: 0.1.0-alpha.5
2 parents 264913b + 1a91085 commit a54194f

27 files changed

Lines changed: 197 additions & 335 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.prism.log
12
.vscode
23
_dev
34

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.4"
2+
".": "0.1.0-alpha.5"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 15
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-e741833ec80041045f2b16ea82c2bd4c7b2d4b4bf0ec0f5698b20ece98763d00.yml
1+
configured_endpoints: 14
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-ce4dc6d4d8a6587f304abdd5adf686e08612cab1c5f1cae3cdf8e20ff4a98d2b.yml

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

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+
314
## 0.1.0-alpha.4 (2024-06-26)
415

516
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)

api.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Methods:
1717
- <code title="post /v1/devboxes">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">create</a>(\*\*<a href="src/runloop_api_client/types/devbox_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
1818
- <code title="get /v1/devboxes/{id}">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
1919
- <code title="get /v1/devboxes">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">list</a>(\*\*<a href="src/runloop_api_client/types/devbox_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_list_view.py">DevboxListView</a></code>
20-
- <code title="post /v1/devboxes/{id}/execute_sync">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">execute_sync</a>(id) -> <a href="./src/runloop_api_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
20+
- <code title="post /v1/devboxes/{id}/execute_sync">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">execute_sync</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_execute_sync_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
2121
- <code title="post /v1/devboxes/{id}/shutdown">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">shutdown</a>(id) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
2222

2323
## Logs
@@ -60,18 +60,6 @@ Methods:
6060
- <code title="get /v1/functions/invocations">client.functions.invocations.<a href="./src/runloop_api_client/resources/functions/invocations/invocations.py">list</a>() -> <a href="./src/runloop_api_client/types/functions/function_invocation_list_view.py">FunctionInvocationListView</a></code>
6161
- <code title="post /v1/functions/invocations/{invocationId}/kill">client.functions.invocations.<a href="./src/runloop_api_client/resources/functions/invocations/invocations.py">kill</a>(invocation_id) -> <a href="./src/runloop_api_client/types/functions/kill_operation_response.py">object</a></code>
6262

63-
### Spans
64-
65-
Types:
66-
67-
```python
68-
from runloop_api_client.types.functions.invocations import InvocationSpanListView
69-
```
70-
71-
Methods:
72-
73-
- <code title="get /v1/functions/invocations/{invocationId}/spans">client.functions.invocations.spans.<a href="./src/runloop_api_client/resources/functions/invocations/spans.py">list</a>(invocation_id) -> <a href="./src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py">InvocationSpanListView</a></code>
74-
7563
# Projects
7664

7765
Types:

pyproject.toml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "runloop_api_client"
3-
version = "0.1.0-alpha.4"
3+
version = "0.1.0-alpha.5"
44
description = "The official Python library for the runloop API"
55
dynamic = ["readme"]
66
license = "MIT"
@@ -58,6 +58,7 @@ dev-dependencies = [
5858
"nox",
5959
"dirty-equals>=0.6.0",
6060
"importlib-metadata>=6.7.0",
61+
"rich>=13.7.1",
6162

6263
]
6364

@@ -99,6 +100,21 @@ include = [
99100
[tool.hatch.build.targets.wheel]
100101
packages = ["src/runloop_api_client"]
101102

103+
[tool.hatch.build.targets.sdist]
104+
# Basically everything except hidden files/directories (such as .github, .devcontainers, .python-version, etc)
105+
include = [
106+
"/*.toml",
107+
"/*.json",
108+
"/*.lock",
109+
"/*.md",
110+
"/mypy.ini",
111+
"/noxfile.py",
112+
"bin/*",
113+
"examples/*",
114+
"src/*",
115+
"tests/*",
116+
]
117+
102118
[tool.hatch.metadata.hooks.fancy-pypi-readme]
103119
content-type = "text/markdown"
104120

requirements-dev.lock

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
-e file:.
1111
annotated-types==0.6.0
1212
# via pydantic
13-
anyio==4.1.0
13+
anyio==4.4.0
1414
# via httpx
1515
# via runloop-api-client
1616
argcomplete==3.1.2
@@ -44,6 +44,10 @@ idna==3.4
4444
importlib-metadata==7.0.0
4545
iniconfig==2.0.0
4646
# via pytest
47+
markdown-it-py==3.0.0
48+
# via rich
49+
mdurl==0.1.2
50+
# via markdown-it-py
4751
mypy==1.7.1
4852
mypy-extensions==1.0.0
4953
# via mypy
@@ -63,6 +67,8 @@ pydantic==2.7.1
6367
# via runloop-api-client
6468
pydantic-core==2.18.2
6569
# via pydantic
70+
pygments==2.18.0
71+
# via rich
6672
pyright==1.1.364
6773
pytest==7.1.1
6874
# via pytest-asyncio
@@ -72,6 +78,7 @@ python-dateutil==2.8.2
7278
pytz==2023.3.post1
7379
# via dirty-equals
7480
respx==0.20.2
81+
rich==13.7.1
7582
ruff==0.1.9
7683
setuptools==68.2.2
7784
# via nodeenv
@@ -86,6 +93,7 @@ tomli==2.0.1
8693
# via mypy
8794
# via pytest
8895
typing-extensions==4.8.0
96+
# via anyio
8997
# via mypy
9098
# via pydantic
9199
# via pydantic-core

requirements.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
-e file:.
1111
annotated-types==0.6.0
1212
# via pydantic
13-
anyio==4.1.0
13+
anyio==4.4.0
1414
# via httpx
1515
# via runloop-api-client
1616
certifi==2023.7.22
@@ -38,6 +38,7 @@ sniffio==1.3.0
3838
# via httpx
3939
# via runloop-api-client
4040
typing-extensions==4.8.0
41+
# via anyio
4142
# via pydantic
4243
# via pydantic-core
4344
# via runloop-api-client

src/runloop_api_client/_base_client.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
HttpxSendArgs,
5959
AsyncTransport,
6060
RequestOptions,
61+
HttpxRequestFiles,
6162
ModelBuilderProtocol,
6263
)
6364
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
@@ -459,6 +460,7 @@ def _build_request(
459460
headers = self._build_headers(options)
460461
params = _merge_mappings(self.default_query, options.params)
461462
content_type = headers.get("Content-Type")
463+
files = options.files
462464

463465
# If the given Content-Type header is multipart/form-data then it
464466
# has to be removed so that httpx can generate the header with
@@ -472,14 +474,23 @@ def _build_request(
472474
headers.pop("Content-Type")
473475

474476
# As we are now sending multipart/form-data instead of application/json
475-
# we need to tell httpx to use it, https://www.python-httpx.org/advanced/#multipart-file-encoding
477+
# we need to tell httpx to use it, https://www.python-httpx.org/advanced/clients/#multipart-file-encoding
476478
if json_data:
477479
if not is_dict(json_data):
478480
raise TypeError(
479481
f"Expected query input to be a dictionary for multipart requests but got {type(json_data)} instead."
480482
)
481483
kwargs["data"] = self._serialize_multipartform(json_data)
482484

485+
# httpx determines whether or not to send a "multipart/form-data"
486+
# request based on the truthiness of the "files" argument.
487+
# This gets around that issue by generating a dict value that
488+
# evaluates to true.
489+
#
490+
# https://github.com/encode/httpx/discussions/2399#discussioncomment-3814186
491+
if not files:
492+
files = cast(HttpxRequestFiles, ForceMultipartDict())
493+
483494
# TODO: report this error to httpx
484495
return self._client.build_request( # pyright: ignore[reportUnknownMemberType]
485496
headers=headers,
@@ -492,7 +503,7 @@ def _build_request(
492503
# https://github.com/microsoft/pyright/issues/3526#event-6715453066
493504
params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
494505
json=json_data,
495-
files=options.files,
506+
files=files,
496507
**kwargs,
497508
)
498509

@@ -1863,6 +1874,11 @@ def make_request_options(
18631874
return options
18641875

18651876

1877+
class ForceMultipartDict(Dict[str, None]):
1878+
def __bool__(self) -> bool:
1879+
return True
1880+
1881+
18661882
class OtherPlatform:
18671883
def __init__(self, name: str) -> None:
18681884
self.name = name

src/runloop_api_client/_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def __init__(
9393
if base_url is None:
9494
base_url = os.environ.get("RUNLOOP_BASE_URL")
9595
if base_url is None:
96-
base_url = f"https://api.runloop.pro"
96+
base_url = f"https://api.runloop.ai"
9797

9898
super().__init__(
9999
version=__version__,
@@ -265,7 +265,7 @@ def __init__(
265265
if base_url is None:
266266
base_url = os.environ.get("RUNLOOP_BASE_URL")
267267
if base_url is None:
268-
base_url = f"https://api.runloop.pro"
268+
base_url = f"https://api.runloop.ai"
269269

270270
super().__init__(
271271
version=__version__,

0 commit comments

Comments
 (0)