Skip to content

Commit 13cf486

Browse files
chrisdengsogithub-actions[bot]
authored andcommitted
feat!: regenerate from OpenAPI spec with Speakeasy
1 parent 3ece7e6 commit 13cf486

590 files changed

Lines changed: 37177 additions & 28388 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: 0 additions & 8 deletions
This file was deleted.

‎.devcontainer/devcontainer.json‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

‎.gitattributes‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This allows generated code to be indexed correctly
2+
*.py linguist-generated=false

‎.github/workflows/ci.yml‎

Lines changed: 15 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,25 @@
1+
# Maintained in moderation-api/sdk-generator (custom/python). Edits here are overwritten.
12
name: CI
23
on:
34
push:
4-
branches:
5-
- '**'
6-
- '!integrated/**'
7-
- '!stl-preview-head/**'
8-
- '!stl-preview-base/**'
9-
- '!generated'
10-
- '!codegen/**'
11-
- 'codegen/stl/**'
5+
branches: [main]
126
pull_request:
13-
branches-ignore:
14-
- 'stl-preview-head/**'
15-
- 'stl-preview-base/**'
167

17-
jobs:
18-
lint:
19-
timeout-minutes: 10
20-
name: lint
21-
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
22-
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
23-
steps:
24-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
25-
26-
- name: Install uv
27-
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
28-
with:
29-
version: '0.10.2'
30-
31-
- name: Install dependencies
32-
run: uv sync --all-extras
33-
34-
- name: Run lints
35-
run: ./scripts/lint
8+
permissions:
9+
contents: read
3610

11+
jobs:
3712
build:
38-
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
39-
timeout-minutes: 10
40-
name: build
41-
permissions:
42-
contents: read
43-
id-token: write
44-
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
13+
runs-on: ubuntu-latest
4514
steps:
4615
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
47-
48-
- name: Install uv
49-
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
16+
- uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
5017
with:
51-
version: '0.10.2'
52-
53-
- name: Install dependencies
54-
run: uv sync --all-extras
55-
56-
- name: Run build
57-
run: uv build
58-
59-
- name: Get GitHub OIDC Token
60-
if: |-
61-
github.repository == 'stainless-sdks/moderation-api-python' &&
62-
!startsWith(github.ref, 'refs/heads/stl/')
63-
id: github-oidc
64-
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
65-
with:
66-
script: core.setOutput('github_token', await core.getIDToken());
67-
68-
- name: Upload tarball
69-
if: |-
70-
github.repository == 'stainless-sdks/moderation-api-python' &&
71-
!startsWith(github.ref, 'refs/heads/stl/')
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-
78-
test:
79-
timeout-minutes: 10
80-
name: test
81-
runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
82-
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
83-
steps:
84-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
85-
86-
- name: Install uv
87-
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
88-
with:
89-
version: '0.10.2'
90-
91-
- name: Bootstrap
92-
run: ./scripts/bootstrap
93-
94-
- name: Run tests
95-
run: ./scripts/test
18+
version: "0.9.13"
19+
- run: uv sync --group dev
20+
- run: uv run pylint --rcfile=pylintrc src
21+
- run: uv run mypy src
22+
- run: uv run pyright src
23+
- run: uv build
24+
- name: Import the package
25+
run: uv run python -c "from moderation_api import ModerationAPI; from moderation_api.webhook_signature import construct_event"

‎.github/workflows/publish-pypi.yml‎

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,29 @@
1-
# This workflow is triggered when a GitHub release is created.
2-
# It can also be run manually to re-publish to PyPI in case it failed for some reason.
3-
# You can run this workflow by navigating to https://www.github.com/moderation-api/sdk-python/actions/workflows/publish-pypi.yml
1+
# Maintained in moderation-api/sdk-generator (custom/python). Edits here are overwritten.
42
name: Publish PyPI
53
on:
6-
workflow_dispatch:
7-
84
release:
95
types: [published]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
1010

1111
jobs:
1212
publish:
13-
name: publish
1413
runs-on: ubuntu-latest
15-
1614
steps:
1715
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
18-
19-
- name: Install uv
20-
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
16+
- uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
2117
with:
22-
version: '0.9.13'
23-
24-
- name: Publish to PyPI
18+
version: "0.9.13"
19+
- name: Check the release tag matches pyproject.toml
20+
if: github.event_name == 'release'
2521
run: |
26-
bash ./bin/publish-pypi
22+
version=$(sed -n 's/^version = "\(.*\)"$/\1/p' pyproject.toml | head -1)
23+
if [ "${GITHUB_REF_NAME#v}" != "$version" ]; then
24+
echo "::error::Release tag $GITHUB_REF_NAME does not match pyproject.toml version $version"
25+
exit 1
26+
fi
27+
- run: bash scripts/publish.sh
2728
env:
2829
PYPI_TOKEN: ${{ secrets.MODERATION_API_PYPI_TOKEN || secrets.PYPI_TOKEN }}

‎.github/workflows/release-doctor.yml‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎.gitignore‎

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
.prism.log
2-
.stdy.log
3-
_dev
4-
5-
__pycache__
6-
.mypy_cache
7-
8-
dist
9-
10-
.venv
11-
.idea
12-
1+
.venv/
2+
venv/
3+
src/*.egg-info/
4+
**/__pycache__/
5+
.pytest_cache/
6+
.python-version
7+
.DS_Store
8+
pyrightconfig.json
9+
**/.speakeasy/temp/
10+
**/.speakeasy/logs/
11+
.speakeasy/reports
1312
.env
14-
.envrc
15-
codegen.log
16-
Brewfile.lock.json
13+
.env.local

‎.python-version‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎.release-please-manifest.json‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)