Skip to content

Commit ff05a4a

Browse files
feat(api): update via SDK Studio
1 parent 6040171 commit ff05a4a

File tree

130 files changed

+17166
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+17166
-1
lines changed

.devcontainer/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ARG VARIANT="3.9"
2+
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
3+
4+
USER vscode
5+
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
8+
9+
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc

.devcontainer/devcontainer.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
3+
{
4+
"name": "Debian",
5+
"build": {
6+
"dockerfile": "Dockerfile",
7+
"context": ".."
8+
},
9+
10+
"postStartCommand": "rye sync --all-features",
11+
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"ms-python.python"
16+
],
17+
"settings": {
18+
"terminal.integrated.shell.linux": "/bin/bash",
19+
"python.pythonPath": ".venv/bin/python",
20+
"python.defaultInterpreterPath": ".venv/bin/python",
21+
"python.typeChecking": "basic",
22+
"terminal.integrated.env.linux": {
23+
"PATH": "/home/vscode/.rye/shims:${env:PATH}"
24+
}
25+
}
26+
}
27+
},
28+
"features": {
29+
"ghcr.io/devcontainers/features/node:1": {}
30+
}
31+
32+
// Features to add to the dev container. More info: https://containers.dev/features.
33+
// "features": {},
34+
35+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
36+
// "forwardPorts": [],
37+
38+
// Configure tool-specific properties.
39+
// "customizations": {},
40+
41+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
42+
// "remoteUser": "root"
43+
}

.github/workflows/ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI
2+
on:
3+
push:
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
10+
pull_request:
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
14+
15+
jobs:
16+
lint:
17+
timeout-minutes: 10
18+
name: lint
19+
runs-on: ${{ github.repository == 'stainless-sdks/opencode-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Install Rye
24+
run: |
25+
curl -sSf https://rye.astral.sh/get | bash
26+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
27+
env:
28+
RYE_VERSION: '0.44.0'
29+
RYE_INSTALL_OPTION: '--yes'
30+
31+
- name: Install dependencies
32+
run: rye sync --all-features
33+
34+
- name: Run lints
35+
run: ./scripts/lint
36+
37+
upload:
38+
if: github.repository == 'stainless-sdks/opencode-python'
39+
timeout-minutes: 10
40+
name: upload
41+
permissions:
42+
contents: read
43+
id-token: write
44+
runs-on: depot-ubuntu-24.04
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Get GitHub OIDC Token
49+
id: github-oidc
50+
uses: actions/github-script@v6
51+
with:
52+
script: core.setOutput('github_token', await core.getIDToken());
53+
54+
- name: Upload tarball
55+
env:
56+
URL: https://pkg.stainless.com/s
57+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
58+
SHA: ${{ github.sha }}
59+
run: ./scripts/utils/upload-artifact.sh
60+
61+
test:
62+
timeout-minutes: 10
63+
name: test
64+
runs-on: ${{ github.repository == 'stainless-sdks/opencode-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
65+
steps:
66+
- uses: actions/checkout@v4
67+
68+
- name: Install Rye
69+
run: |
70+
curl -sSf https://rye.astral.sh/get | bash
71+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
72+
env:
73+
RYE_VERSION: '0.44.0'
74+
RYE_INSTALL_OPTION: '--yes'
75+
76+
- name: Bootstrap
77+
run: ./scripts/bootstrap
78+
79+
- name: Run tests
80+
run: ./scripts/test

.github/workflows/create-releases.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Create releases
2+
on:
3+
schedule:
4+
- cron: '0 5 * * *' # every day at 5am UTC
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
release:
11+
name: release
12+
if: github.ref == 'refs/heads/main' && github.repository == 'sst/opencode-sdk-python'
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: stainless-api/trigger-release-please@v1
19+
id: release
20+
with:
21+
repo: ${{ github.event.repository.full_name }}
22+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
23+
24+
- name: Install Rye
25+
if: ${{ steps.release.outputs.releases_created }}
26+
run: |
27+
curl -sSf https://rye.astral.sh/get | bash
28+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
29+
env:
30+
RYE_VERSION: '0.44.0'
31+
RYE_INSTALL_OPTION: '--yes'
32+
33+
- name: Publish to PyPI
34+
if: ${{ steps.release.outputs.releases_created }}
35+
run: |
36+
bash ./bin/publish-pypi
37+
env:
38+
PYPI_TOKEN: ${{ secrets.OPENCODE_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.github/workflows/publish-pypi.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# workflow for re-running publishing to PyPI in case it fails for some reason
2+
# you can run this workflow by navigating to https://www.github.com/sst/opencode-sdk-python/actions/workflows/publish-pypi.yml
3+
name: Publish PyPI
4+
on:
5+
workflow_dispatch:
6+
7+
jobs:
8+
publish:
9+
name: publish
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install Rye
16+
run: |
17+
curl -sSf https://rye.astral.sh/get | bash
18+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
19+
env:
20+
RYE_VERSION: '0.44.0'
21+
RYE_INSTALL_OPTION: '--yes'
22+
23+
- name: Publish to PyPI
24+
run: |
25+
bash ./bin/publish-pypi
26+
env:
27+
PYPI_TOKEN: ${{ secrets.OPENCODE_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.github/workflows/release-doctor.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release Doctor
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
8+
jobs:
9+
release_doctor:
10+
name: release doctor
11+
runs-on: ubuntu-latest
12+
if: github.repository == 'sst/opencode-sdk-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment
20+
env:
21+
STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }}
22+
PYPI_TOKEN: ${{ secrets.OPENCODE_PYPI_TOKEN || secrets.PYPI_TOKEN }}

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.prism.log
2+
.vscode
3+
_dev
4+
5+
__pycache__
6+
.mypy_cache
7+
8+
dist
9+
10+
.venv
11+
.idea
12+
13+
.env
14+
.envrc
15+
codegen.log
16+
Brewfile.lock.json

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.9.18

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.0.1-alpha.0"
3+
}

.stats.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
configured_endpoints: 16
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/opencode%2Fopencode-3c79948402e96d2aae6e46095db2cf80759750d1b042d6f91281a72c415b14de.yml
3+
openapi_spec_hash: f9c2fc5988f0a30397929995c2be2c85
4+
config_hash: 482f0765aa5f3dbc38c35bc576a4946e

0 commit comments

Comments
 (0)