Skip to content

Commit 48e138a

Browse files
release: 2.0.0-beta.4 (#94)
* chore(internal): codegen related update * codegen metadata * codegen metadata * feat(api): manual updates * chore: pin mypy to 1.17 due to regression * fix: ensure streams are always closed * fix: uv v0.8.11 only has python 3.14rc, which causes issues with pydantic 2 * chore: formatting * release: 2.0.0-beta.4 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Samuel El-Borai <[email protected]>
1 parent 0183932 commit 48e138a

File tree

22 files changed

+1823
-1488
lines changed

22 files changed

+1823
-1488
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
33

44
USER vscode
55

6-
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash
7-
ENV PATH=/home/vscode/.rye/shims:$PATH
6+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
87

98
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc

.devcontainer/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"context": ".."
88
},
99

10-
"postStartCommand": "rye sync --all-features",
10+
"postStartCommand": "uv sync --all-extras",
1111

1212
"customizations": {
1313
"vscode": {
@@ -20,7 +20,7 @@
2020
"python.defaultInterpreterPath": ".venv/bin/python",
2121
"python.typeChecking": "basic",
2222
"terminal.integrated.env.linux": {
23-
"PATH": "/home/vscode/.rye/shims:${env:PATH}"
23+
"PATH": "${env:PATH}"
2424
}
2525
}
2626
}

.github/workflows/ci.yml

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: CI
22
on:
33
push:
44
branches-ignore:
5-
- 'generated'
6-
- 'codegen/**'
7-
- 'integrated/**'
8-
- 'stl-preview-head/**'
9-
- 'stl-preview-base/**'
5+
- "generated"
6+
- "codegen/**"
7+
- "integrated/**"
8+
- "stl-preview-head/**"
9+
- "stl-preview-base/**"
1010
pull_request:
1111
branches-ignore:
12-
- 'stl-preview-head/**'
13-
- 'stl-preview-base/**'
12+
- "stl-preview-head/**"
13+
- "stl-preview-base/**"
1414

1515
jobs:
1616
lint:
@@ -21,16 +21,11 @@ jobs:
2121
steps:
2222
- uses: actions/checkout@v4
2323

24-
- name: Install Rye
25-
run: |
26-
curl -sSf https://rye.astral.sh/get | bash
27-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
28-
env:
29-
RYE_VERSION: '0.44.0'
30-
RYE_INSTALL_OPTION: '--yes'
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v5
3126

3227
- name: Install dependencies
33-
run: rye sync --all-features
28+
run: uv sync --all-extras
3429

3530
- name: Run lints
3631
run: ./scripts/lint
@@ -46,19 +41,14 @@ jobs:
4641
steps:
4742
- uses: actions/checkout@v4
4843

49-
- name: Install Rye
50-
run: |
51-
curl -sSf https://rye.astral.sh/get | bash
52-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
53-
env:
54-
RYE_VERSION: '0.44.0'
55-
RYE_INSTALL_OPTION: '--yes'
44+
- name: Install uv
45+
uses: astral-sh/setup-uv@v5
5646

5747
- name: Install dependencies
58-
run: rye sync --all-features
48+
run: uv sync --all-extras
5949

6050
- name: Run build
61-
run: rye build
51+
run: uv build
6252

6353
- name: Get GitHub OIDC Token
6454
if: github.repository == 'stainless-sdks/replicate-client-python'
@@ -83,13 +73,8 @@ jobs:
8373
steps:
8474
- uses: actions/checkout@v4
8575

86-
- name: Install Rye
87-
run: |
88-
curl -sSf https://rye.astral.sh/get | bash
89-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
90-
env:
91-
RYE_VERSION: '0.44.0'
92-
RYE_INSTALL_OPTION: '--yes'
76+
- name: Install uv
77+
uses: astral-sh/setup-uv@v5
9378

9479
- name: Bootstrap
9580
run: ./scripts/bootstrap

.github/workflows/publish-pypi.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,8 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818

19-
- name: Install Rye
20-
run: |
21-
curl -sSf https://rye.astral.sh/get | bash
22-
echo "$HOME/.rye/shims" >> $GITHUB_PATH
23-
env:
24-
RYE_VERSION: '0.44.0'
25-
RYE_INSTALL_OPTION: '--yes'
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v5
2621

2722
- name: Publish to PyPI
2823
run: |

.release-please-manifest.json

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

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 37
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/replicate%2Freplicate-client-7a537f433b0b71a42a3d53ce6182cc06790157bbb379461eed93cdb68659bc92.yml
33
openapi_spec_hash: 5c7633dce3ece58e21f74d826946914c
4-
config_hash: 2d6c50f99a6e3ed5963885980a9e4425
4+
config_hash: e879500b6a97f9096703a56044f1cb5f

Brewfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
brew "rye"
1+
brew "uv"
22

CHANGELOG.md

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

3+
## 2.0.0-beta.4 (2025-11-27)
4+
5+
Full Changelog: [v2.0.0-beta.3...v2.0.0-beta.4](https://github.com/replicate/replicate-python-beta/compare/v2.0.0-beta.3...v2.0.0-beta.4)
6+
7+
### Features
8+
9+
* **api:** manual updates ([1a88ecc](https://github.com/replicate/replicate-python-beta/commit/1a88ecc6bb12b509f78662bcd23e46952ef745a0))
10+
11+
12+
### Bug Fixes
13+
14+
* ensure streams are always closed ([88c596d](https://github.com/replicate/replicate-python-beta/commit/88c596dd9b09101b63f6c90862b6f7f144e0c54d))
15+
* uv v0.8.11 only has python 3.14rc, which causes issues with pydantic 2 ([e7267be](https://github.com/replicate/replicate-python-beta/commit/e7267be73de9ccc5cc0a644a07a333538a6df8a3))
16+
17+
18+
### Chores
19+
20+
* formatting ([6d6a349](https://github.com/replicate/replicate-python-beta/commit/6d6a349435fc178d8b4b788a25c96a0593c79288))
21+
* **internal:** codegen related update ([ab0983f](https://github.com/replicate/replicate-python-beta/commit/ab0983f58f734a55f2c3cd55adfd4af564aec660))
22+
* pin mypy to 1.17 due to regression ([19ac33c](https://github.com/replicate/replicate-python-beta/commit/19ac33cf0005ac99cd719e44cae6b5b27833fbbf))
23+
324
## 2.0.0-beta.3 (2025-11-11)
425

526
Full Changelog: [v2.0.0-beta.2...v2.0.0-beta.3](https://github.com/replicate/replicate-python-beta/compare/v2.0.0-beta.2...v2.0.0-beta.3)

CONTRIBUTING.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
## Setting up the environment
22

3-
### With Rye
3+
### With `uv`
44

5-
We use [Rye](https://rye.astral.sh/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
5+
We use [uv](https://docs.astral.sh/uv/) to manage dependencies because it will automatically provision a Python environment with the expected Python version. To set it up, run:
66

77
```sh
88
$ ./scripts/bootstrap
99
```
1010

11-
Or [install Rye manually](https://rye.astral.sh/guide/installation/) and run:
11+
Or [install uv manually](https://docs.astral.sh/uv/getting-started/installation/) and run:
1212

1313
```sh
14-
$ rye sync --all-features
14+
$ uv sync --all-extras
1515
```
1616

17-
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
17+
You can then run scripts using `uv run python script.py` or by manually activating the virtual environment:
1818

1919
```sh
20-
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
20+
# manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
2121
$ source .venv/bin/activate
2222

23-
# now you can omit the `rye run` prefix
23+
# now you can omit the `uv run` prefix
2424
$ python script.py
2525
```
2626

27-
### Without Rye
27+
### Without `uv`
2828

29-
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:
29+
Alternatively if you don't want to install `uv`, 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:
3030

3131
```sh
3232
$ pip install -r requirements-dev.lock
@@ -45,7 +45,7 @@ All files in the `examples/` directory are not modified by the generator and can
4545
```py
4646
# add an example to examples/<your-example>.py
4747

48-
#!/usr/bin/env -S rye run python
48+
#!/usr/bin/env -S uv run python
4949
5050
```
5151

@@ -72,7 +72,7 @@ Building this package will create two files in the `dist/` directory, a `.tar.gz
7272
To create a distributable version of the library, all you have to do is run this command:
7373

7474
```sh
75-
$ rye build
75+
$ uv build
7676
# or
7777
$ python -m build
7878
```

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ seedream = replicate.use("bytedance/seedream-4")
4040
veo = replicate.use("google/veo-3-fast")
4141

4242
# Enhance a simple prompt
43-
image_prompt = claude(prompt="bananas wearing cowboy hats", system_prompt="turn prompts into image prompts")
43+
image_prompt = claude(
44+
prompt="bananas wearing cowboy hats", system_prompt="turn prompts into image prompts"
45+
)
4446

4547
# Generate an image from the enhanced prompt
4648
images = seedream(prompt=image_prompt)
@@ -59,9 +61,7 @@ The library uses the `REPLICATE_API_TOKEN` environment variable by default to im
5961
import os
6062
from replicate import Replicate
6163

62-
client = Replicate(
63-
bearer_token=os.environ.get("REPLICATE_API_TOKEN")
64-
)
64+
client = Replicate(bearer_token=os.environ.get("REPLICATE_API_TOKEN"))
6565
```
6666

6767
## Using `replicate.use()`

0 commit comments

Comments
 (0)