Skip to content

Commit 3e19420

Browse files
committed
Merge upstream/main to resolve conflicts
Resolved merge conflict in src/openai/lib/_parsing/_completions.py by including both imports (logging and weakref) that are needed for: - Memory leak fix (weakref for WeakKeyDictionary cache) - Logging functionality (logging for log warnings) This brings the fix-memory-leak-in-async-completions-parse branch up to date with the latest main branch.
2 parents d595725 + dff16b5 commit 3e19420

885 files changed

Lines changed: 64032 additions & 7773 deletions

File tree

Some content is hidden

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

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ 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.35.0" RYE_INSTALL_OPTION="--yes" bash
6+
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash
77
ENV PATH=/home/vscode/.rye/shims:$PATH
88

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

.github/workflows/ci.yml

Lines changed: 86 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- main
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
610
pull_request:
7-
branches:
8-
- main
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
914

1015
jobs:
1116
lint:
17+
timeout-minutes: 10
1218
name: lint
13-
runs-on: ubuntu-latest
14-
if: github.repository == 'openai/openai-python'
15-
19+
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
1621
steps:
1722
- uses: actions/checkout@v4
1823

@@ -21,7 +26,7 @@ jobs:
2126
curl -sSf https://rye.astral.sh/get | bash
2227
echo "$HOME/.rye/shims" >> $GITHUB_PATH
2328
env:
24-
RYE_VERSION: '0.35.0'
29+
RYE_VERSION: '0.44.0'
2530
RYE_INSTALL_OPTION: '--yes'
2631

2732
- name: Install dependencies
@@ -30,11 +35,51 @@ jobs:
3035
- name: Run lints
3136
run: ./scripts/lint
3237

38+
build:
39+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
40+
timeout-minutes: 10
41+
name: build
42+
permissions:
43+
contents: read
44+
id-token: write
45+
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
46+
steps:
47+
- uses: actions/checkout@v4
48+
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'
56+
57+
- name: Install dependencies
58+
run: rye sync --all-features
59+
60+
- name: Run build
61+
run: rye build
62+
63+
- name: Get GitHub OIDC Token
64+
if: github.repository == 'stainless-sdks/openai-python'
65+
id: github-oidc
66+
uses: actions/github-script@v6
67+
with:
68+
script: core.setOutput('github_token', await core.getIDToken());
69+
70+
- name: Upload tarball
71+
if: github.repository == 'stainless-sdks/openai-python'
72+
env:
73+
URL: https://pkg.stainless.com/s
74+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
75+
SHA: ${{ github.sha }}
76+
run: ./scripts/utils/upload-artifact.sh
77+
3378
test:
79+
timeout-minutes: 10
3480
name: test
35-
runs-on: ubuntu-latest
36-
if: github.repository == 'openai/openai-python'
37-
81+
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
82+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
3883
steps:
3984
- uses: actions/checkout@v4
4085

@@ -43,11 +88,40 @@ jobs:
4388
curl -sSf https://rye.astral.sh/get | bash
4489
echo "$HOME/.rye/shims" >> $GITHUB_PATH
4590
env:
46-
RYE_VERSION: '0.35.0'
91+
RYE_VERSION: '0.44.0'
4792
RYE_INSTALL_OPTION: '--yes'
4893

4994
- name: Bootstrap
5095
run: ./scripts/bootstrap
5196

5297
- name: Run tests
5398
run: ./scripts/test
99+
100+
examples:
101+
timeout-minutes: 10
102+
name: examples
103+
runs-on: ${{ github.repository == 'stainless-sdks/openai-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
104+
if: github.repository == 'openai/openai-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
105+
106+
steps:
107+
- uses: actions/checkout@v4
108+
109+
- name: Install Rye
110+
run: |
111+
curl -sSf https://rye.astral.sh/get | bash
112+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
113+
env:
114+
RYE_VERSION: '0.44.0'
115+
RYE_INSTALL_OPTION: '--yes'
116+
- name: Install dependencies
117+
run: |
118+
rye sync --all-features
119+
120+
- env:
121+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
122+
run: |
123+
rye run python examples/demo.py
124+
- env:
125+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
126+
run: |
127+
rye run python examples/async_demo.py

.github/workflows/create-releases.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
curl -sSf https://rye.astral.sh/get | bash
2929
echo "$HOME/.rye/shims" >> $GITHUB_PATH
3030
env:
31-
RYE_VERSION: '0.35.0'
31+
RYE_VERSION: '0.44.0'
3232
RYE_INSTALL_OPTION: '--yes'
3333

3434
- name: Publish to PyPI
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- next
7+
8+
jobs:
9+
detect_breaking_changes:
10+
runs-on: 'ubuntu-latest'
11+
name: detect-breaking-changes
12+
if: github.repository == 'openai/openai-python'
13+
steps:
14+
- name: Calculate fetch-depth
15+
run: |
16+
echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV
17+
18+
- uses: actions/checkout@v4
19+
with:
20+
# Ensure we can check out the pull request base in the script below.
21+
fetch-depth: ${{ env.FETCH_DEPTH }}
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+
- name: Install dependencies
31+
run: |
32+
rye sync --all-features
33+
- name: Detect removed symbols
34+
run: |
35+
rye run python scripts/detect-breaking-changes.py "${{ github.event.pull_request.base.sha }}"
36+
37+
- name: Detect breaking changes
38+
run: |
39+
# Try to check out previous versions of the breaking change detection script. This ensures that
40+
# we still detect breaking changes when entire files and their tests are removed.
41+
git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true
42+
./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }}

.github/workflows/publish-pypi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
curl -sSf https://rye.astral.sh/get | bash
1919
echo "$HOME/.rye/shims" >> $GITHUB_PATH
2020
env:
21-
RYE_VERSION: '0.35.0'
21+
RYE_VERSION: '0.44.0'
2222
RYE_INSTALL_OPTION: '--yes'
2323

2424
- name: Publish to PyPI

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.prism.log
2-
.vscode
32
_dev
43

54
__pycache__
@@ -14,3 +13,7 @@ dist
1413
.envrc
1514
codegen.log
1615
Brewfile.lock.json
16+
17+
.DS_Store
18+
19+
examples/*.mp3

.release-please-manifest.json

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

.stats.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
configured_endpoints: 74
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-4aa6ee65ba9efc789e05e6a5ef0883b2cadf06def8efd863dbf75e9e233067e1.yml
1+
configured_endpoints: 136
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-812a10f8fb54c584efc914422b574cb3f43dc238b5733b13f6a0b2308b7d9910.yml
3+
openapi_spec_hash: 0222041ba12a5ff6b94924a834fa91a2
4+
config_hash: 50ee3382a63c021a9f821a935950e926

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.analysis.importFormat": "relative",
3+
}

0 commit comments

Comments
 (0)