Skip to content

Commit 715c9d0

Browse files
sid-rladam-rl
andauthored
chore: remove some unnecessary changes to reduce diff from Stainless (#705)
* Remove some unneccessary changes to reduce the diff from Stainless These diffs were reported by Stainless as custom code patches, which we are not interested in maintaining. * update pyproject.toml to add support for python 3.14, remove rye dependencies. regenerate uv.lock and requirements-dev.lock * update test script (skip pydantic v1 tests on python 3.14) * add formatting for sdk README * change uv version requirement to >= 0.8 * upgrade uv back to >= 0.9 --------- Co-authored-by: Adam Lesinski <adam@runloop.ai>
1 parent 6928652 commit 715c9d0

8 files changed

Lines changed: 594 additions & 297 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Install uv
2525
uses: runloopai/setup-uv@main
2626
with:
27-
version: '0.8.11'
27+
version: '0.9.13'
2828

2929
- name: Install dependencies
3030
run: uv sync --all-extras
@@ -46,7 +46,7 @@ jobs:
4646
- name: Install uv
4747
uses: runloopai/setup-uv@main
4848
with:
49-
version: '0.8.11'
49+
version: '0.9.13'
5050

5151
- name: Install dependencies
5252
run: uv sync --all-extras
@@ -80,10 +80,10 @@ jobs:
8080
- name: Install uv
8181
uses: runloopai/setup-uv@main
8282
with:
83-
version: '0.8.11'
83+
version: '0.9.13'
8484

8585
- name: Bootstrap
8686
run: ./scripts/bootstrap
8787

8888
- name: Run tests
89-
run: ./scripts/test --ignore=tests/smoketests
89+
run: ./scripts/test

README-SDK.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ print(obj.download_as_text())
7777
import asyncio
7878
from runloop_api_client import AsyncRunloopSDK
7979

80+
8081
async def main():
8182
runloop = AsyncRunloopSDK()
8283
async with await runloop.devbox.create(name="async-devbox") as devbox:
@@ -88,6 +89,7 @@ async def main():
8889

8990
await devbox.cmd.exec("ls", stdout=capture)
9091

92+
9193
asyncio.run(main())
9294
```
9395

@@ -194,7 +196,7 @@ print("Devbox ID:", execution.devbox_id)
194196
# Poll for current state
195197
state = execution.get_state()
196198
print("Status:", state.status) # "running", "completed", etc.
197-
print("Exit code:", state.exit_status) # only set when execution has completed
199+
print("Exit code:", state.exit_status) # only set when execution has completed
198200

199201
# Wait for completion and get results
200202
result = execution.result()
@@ -229,7 +231,7 @@ result = execution.result()
229231
# Access execution results
230232
print("Exit code:", result.exit_code)
231233
print("Success:", result.success) # True if exit code is 0
232-
print("Failed:", result.failed) # True if exit code is non-zero
234+
print("Failed:", result.failed) # True if exit code is non-zero
233235

234236
# Get output streams
235237
stdout = result.stdout()
@@ -261,6 +263,7 @@ Pass callbacks into `cmd.exec` / `cmd.exec_async` to process logs in real time:
261263
def handle_output(line: str) -> None:
262264
print("LOG:", line)
263265

266+
264267
result = devbox.cmd.exec(
265268
"python train.py",
266269
stdout=handle_output,
@@ -278,6 +281,7 @@ def capture(line: str) -> None:
278281
# Use thread-safe data structures if needed
279282
log_queue.put_nowait(line)
280283

284+
281285
await devbox.cmd.exec(
282286
"tail -f /var/log/app.log",
283287
stdout=capture,
@@ -299,6 +303,7 @@ print(content)
299303

300304
# Upload files
301305
from pathlib import Path
306+
302307
devbox.file.upload(
303308
path="/home/user/upload.txt",
304309
file=Path("local_file.txt"),
@@ -535,6 +540,7 @@ storage_object.complete()
535540

536541
# Upload from file
537542
from pathlib import Path
543+
538544
uploaded = runloop.storage_object.upload_from_file(
539545
Path("/path/to/file.txt"),
540546
name="my-file.txt",
@@ -584,7 +590,7 @@ obj = runloop.storage_object.create(
584590
name="data.bin",
585591
content_type="binary",
586592
)
587-
obj.upload_content(b"\xDE\xAD\xBE\xEF")
593+
obj.upload_content(b"\xde\xad\xbe\xef")
588594
obj.complete()
589595
```
590596

@@ -731,28 +737,30 @@ The async SDK has the same interface as the synchronous version, but all I/O ope
731737
import asyncio
732738
from runloop_api_client import AsyncRunloopSDK
733739

740+
734741
async def main():
735742
runloop = AsyncRunloopSDK()
736-
743+
737744
# All the same operations, but with await
738745
async with await runloop.devbox.create(name="async-devbox") as devbox:
739746
result = await devbox.cmd.exec("pwd")
740747
print(await result.stdout())
741-
748+
742749
# Streaming (note: callbacks must be synchronous)
743750
def capture(line: str) -> None:
744751
print(">>", line)
745-
752+
746753
await devbox.cmd.exec("ls", stdout=capture)
747-
754+
748755
# Async file operations
749756
await devbox.file.write(path="/tmp/test.txt", contents="Hello")
750757
content = await devbox.file.read(path="/tmp/test.txt")
751-
758+
752759
# Async network operations
753760
tunnel = await devbox.net.create_tunnel(port=8080)
754761
print("Tunnel URL:", tunnel.url)
755762

763+
756764
asyncio.run(main())
757765
```
758766

@@ -768,15 +776,15 @@ devbox = runloop.devbox.create(
768776
name="my-devbox",
769777
polling_config=PollingConfig(
770778
timeout_seconds=300.0, # Wait up to 5 minutes
771-
interval_seconds=2.0, # Poll every 2 seconds
779+
interval_seconds=2.0, # Poll every 2 seconds
772780
),
773781
)
774782

775783
# Wait for snapshot completion with custom polling
776784
snapshot.await_completed(
777785
polling_config=PollingConfig(
778786
timeout_seconds=600.0, # Wait up to 10 minutes
779-
interval_seconds=5.0, # Poll every 5 seconds
787+
interval_seconds=5.0, # Poll every 5 seconds
780788
),
781789
)
782790
```

pyproject.toml

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ dependencies = [
1616
"sniffio",
1717
"uuid-utils>=0.11.0",
1818
]
19-
2019
requires-python = ">= 3.9"
2120
classifiers = [
2221
"Typing :: Typed",
@@ -26,6 +25,7 @@ classifiers = [
2625
"Programming Language :: Python :: 3.11",
2726
"Programming Language :: Python :: 3.12",
2827
"Programming Language :: Python :: 3.13",
28+
"Programming Language :: Python :: 3.14",
2929
"Operating System :: OS Independent",
3030
"Operating System :: POSIX",
3131
"Operating System :: MacOS",
@@ -44,7 +44,13 @@ aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]
4444

4545
[tool.uv]
4646
managed = true
47-
required-version = ">=0.5.0"
47+
required-version = ">=0.9"
48+
conflicts = [
49+
[
50+
{ group = "pydantic-v1" },
51+
{ group = "pydantic-v2" },
52+
],
53+
]
4854

4955
[dependency-groups]
5056
# version pins are in uv.lock
@@ -64,51 +70,24 @@ dev = [
6470
"uuid-utils>=0.11.0",
6571
"pytest-cov>=7.0.0",
6672
]
73+
pydantic-v1 = [
74+
"pydantic>=1.9.0,<2",
75+
]
76+
pydantic-v2 = [
77+
"pydantic~=2.0 ; python_full_version < '3.14'",
78+
"pydantic~=2.12 ; python_full_version >= '3.14'",
79+
]
6780
docs = [
6881
"furo>=2025.9.25",
6982
"sphinx>=7.4.7",
7083
"sphinx-autodoc-typehints>=2.3.0",
7184
"sphinx-toolbox>=4.0.0",
7285
]
73-
pydantic-v1 = [
74-
"pydantic>=1.9.0, <2",
75-
]
76-
77-
[tool.rye.scripts]
78-
format = { chain = [
79-
"format:ruff",
80-
"format:docs",
81-
"fix:ruff",
82-
# run formatting again to fix any inconsistencies when imports are stripped
83-
"format:ruff",
84-
]}
85-
"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
86-
"format:ruff" = "ruff format"
87-
88-
"lint" = { chain = [
89-
"check:ruff",
90-
"typecheck",
91-
"check:importable",
92-
]}
93-
"check:ruff" = "ruff check ."
94-
"fix:ruff" = "ruff check --fix ."
95-
96-
"check:importable" = "python -c 'import runloop_api_client'"
97-
98-
typecheck = { chain = [
99-
"typecheck:pyright",
100-
"typecheck:mypy"
101-
]}
102-
103-
"typecheck:pyright" = "pyright"
104-
"typecheck:verify-types" = "pyright --verifytypes runloop_api_client --ignoreexternal"
105-
"typecheck:mypy" = "mypy ."
10686

10787
[build-system]
10888
requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
10989
build-backend = "hatchling.build"
11090

111-
11291
[tool.hatch.build]
11392
include = [
11493
"src/*"

requirements-dev.lock

Lines changed: 31 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,16 @@
11
# This file was autogenerated by uv via the following command:
2-
# uv export -o requirements-dev.lock --no-hashes
3-
-e .
4-
annotated-types==0.7.0
5-
# via pydantic
2+
# uv pip compile --group dev --output-file requirements-dev.lock
63
anyio==4.8.0
7-
# via
8-
# httpx
9-
# runloop-api-client
4+
# via httpx
105
certifi==2024.12.14
116
# via
127
# httpcore
138
# httpx
14-
colorama==0.4.6 ; sys_platform == 'win32'
15-
# via pytest
9+
coverage==7.10.7
10+
# via pytest-cov
1611
dirty-equals==0.9.0
17-
distro==1.9.0
18-
# via runloop-api-client
19-
exceptiongroup==1.2.2 ; python_full_version < '3.11'
12+
# via runloop-api-client (pyproject.toml:dev)
13+
exceptiongroup==1.2.2
2014
# via
2115
# anyio
2216
# pytest
@@ -27,68 +21,78 @@ h11==0.16.0
2721
httpcore==1.0.9
2822
# via httpx
2923
httpx==0.28.1
30-
# via
31-
# respx
32-
# runloop-api-client
24+
# via respx
3325
idna==3.10
3426
# via
3527
# anyio
3628
# httpx
3729
importlib-metadata==8.6.1
30+
# via runloop-api-client (pyproject.toml:dev)
3831
iniconfig==2.0.0
3932
# via pytest
4033
markdown-it-py==3.0.0
4134
# via rich
4235
mdurl==0.1.2
4336
# via markdown-it-py
4437
mypy==1.14.1
38+
# via runloop-api-client (pyproject.toml:dev)
4539
mypy-extensions==1.0.0
4640
# via mypy
4741
nodeenv==1.9.1
4842
# via pyright
4943
packaging==24.2
5044
# via pytest
5145
pluggy==1.5.0
52-
# via pytest
53-
pydantic==2.10.3
54-
# via runloop-api-client
55-
pydantic-core==2.27.1
56-
# via pydantic
46+
# via
47+
# pytest
48+
# pytest-cov
5749
pygments==2.19.1
5850
# via
5951
# pytest
6052
# rich
6153
pyright==1.1.399
54+
# via runloop-api-client (pyproject.toml:dev)
6255
pytest==8.4.1
6356
# via
57+
# runloop-api-client (pyproject.toml:dev)
6458
# pytest-asyncio
59+
# pytest-cov
60+
# pytest-timeout
6561
# pytest-xdist
6662
pytest-asyncio==0.24.0
63+
# via runloop-api-client (pyproject.toml:dev)
64+
pytest-cov==7.0.0
65+
# via runloop-api-client (pyproject.toml:dev)
66+
pytest-timeout==2.4.0
67+
# via runloop-api-client (pyproject.toml:dev)
6768
pytest-xdist==3.7.0
69+
# via runloop-api-client (pyproject.toml:dev)
6870
python-dateutil==2.9.0.post0
6971
# via time-machine
7072
respx==0.22.0
73+
# via runloop-api-client (pyproject.toml:dev)
7174
rich==13.9.4
75+
# via runloop-api-client (pyproject.toml:dev)
7276
ruff==0.9.4
77+
# via runloop-api-client (pyproject.toml:dev)
7378
six==1.17.0
7479
# via python-dateutil
7580
sniffio==1.3.1
76-
# via
77-
# anyio
78-
# runloop-api-client
81+
# via anyio
7982
time-machine==2.16.0
80-
tomli==2.2.1 ; python_full_version < '3.11'
83+
# via runloop-api-client (pyproject.toml:dev)
84+
tomli==2.2.1
8185
# via
86+
# coverage
8287
# mypy
8388
# pytest
8489
typing-extensions==4.12.2
8590
# via
8691
# anyio
8792
# mypy
88-
# pydantic
89-
# pydantic-core
9093
# pyright
9194
# rich
92-
# runloop-api-client
95+
uuid-utils==0.12.0
96+
# via runloop-api-client (pyproject.toml:dev)
9397
zipp==3.21.0
9498
# via importlib-metadata

scripts/bootstrap

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ uv python install
2525
echo "==> Installing Python dependencies…"
2626
uv sync --all-extras
2727

28-
uv sync --all-extras --all-groups

scripts/format

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ set -e
44

55
cd "$(dirname "$0")/.."
66

7-
echo "==> Running formatters"
7+
echo "==> Running ruff"
88
uv run ruff format
9-
uv run python scripts/utils/ruffen-docs.py README.md api.md
109
uv run ruff check --fix .
1110
# run formatting again to fix any inconsistencies when imports are stripped
1211
uv run ruff format
12+
13+
echo "==> Formatting docs"
14+
uv run python scripts/utils/ruffen-docs.py README.md api.md README-SDK.md

0 commit comments

Comments
 (0)