Skip to content

Commit 329af03

Browse files
committed
initial commit
0 parents  commit 329af03

File tree

285 files changed

+21175
-0
lines changed

Some content is hidden

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

285 files changed

+21175
-0
lines changed

.devcontainer/README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
> **Remember to shutdown a GitHub Codespace when it is not in use!**
3+
4+
# Dev Containers Quick Start
5+
6+
The default location for usage snippets is the `samples` directory.
7+
8+
## Running a Usage Sample
9+
10+
A sample usage example has been provided in a `root.py` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.
11+
12+
```
13+
python root.py
14+
```
15+
16+
## Generating Additional Usage Samples
17+
18+
The speakeasy CLI allows you to generate more usage snippets. Here's how:
19+
20+
- To generate a sample for a specific operation by providing an operation ID, use:
21+
22+
```
23+
speakeasy generate usage -s .speakeasy/out.openapi.yaml -l python -i {INPUT_OPERATION_ID} -o ./samples
24+
```
25+
26+
- To generate samples for an entire namespace (like a tag or group name), use:
27+
28+
```
29+
speakeasy generate usage -s .speakeasy/out.openapi.yaml -l python -n {INPUT_TAG_NAME} -o ./samples
30+
```

.devcontainer/devcontainer.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/images/tree/main/src/python
3+
{
4+
"name": "Python",
5+
"image": "mcr.microsoft.com/devcontainers/python:1-3.11-bullseye",
6+
// Features to add to the dev container. More info: https://containers.dev/features.
7+
"features": {
8+
"ghcr.io/astral-sh/devcontainer-features/uv:latest": {}
9+
},
10+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
11+
// "forwardPorts": [],
12+
// Use 'postCreateCommand' to run commands after the container is created.
13+
"postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh",
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"ms-python.python",
18+
"ms-python.vscode-pylance",
19+
"github.vscode-pull-request-github"
20+
],
21+
"settings": {
22+
"files.eol": "\n",
23+
"editor.formatOnSave": true,
24+
"python.formatting.provider": "black",
25+
"python.linting.enabled": true,
26+
"python.linting.pylintEnabled": true,
27+
"python.linting.flake8Enabled": true,
28+
"python.linting.banditEnabled": true,
29+
"python.testing.pytestEnabled": true
30+
}
31+
},
32+
"codespaces": {
33+
"openFiles": [
34+
".devcontainer/README.md"
35+
]
36+
}
37+
}
38+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
39+
// "remoteUser": "root"
40+
}

.devcontainer/setup.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
# Install the speakeasy CLI
4+
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh
5+
6+
# Setup samples directory
7+
rmdir samples || true
8+
mkdir samples
9+
10+
11+
uv sync --dev
12+
13+
# Generate starter usage sample with speakeasy
14+
speakeasy generate usage -s .speakeasy/out.openapi.yaml -l python -o samples/root.py

.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
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Generate
2+
permissions:
3+
checks: write
4+
contents: write
5+
pull-requests: write
6+
statuses: write
7+
id-token: write
8+
"on":
9+
workflow_dispatch:
10+
inputs:
11+
force:
12+
description: Force generation of SDKs
13+
type: boolean
14+
default: false
15+
set_version:
16+
description: optionally set a specific SDK version
17+
type: string
18+
schedule:
19+
- cron: 0 0 * * *
20+
pull_request:
21+
types:
22+
- labeled
23+
- unlabeled
24+
jobs:
25+
generate:
26+
uses: speakeasy-api/sdk-generation-action/.github/workflows/workflow-executor.yaml@v15
27+
with:
28+
force: ${{ github.event.inputs.force }}
29+
mode: pr
30+
set_version: ${{ github.event.inputs.set_version }}
31+
secrets:
32+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
33+
pypi_token: ${{ secrets.PYPI_TOKEN }}
34+
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

.github/workflows/sdk_publish.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish
2+
permissions:
3+
checks: write
4+
contents: write
5+
pull-requests: write
6+
statuses: write
7+
id-token: write
8+
"on":
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- .speakeasy/gen.lock
14+
workflow_dispatch: {}
15+
jobs:
16+
publish:
17+
uses: speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15
18+
with:
19+
target: agentset
20+
secrets:
21+
github_access_token: ${{ secrets.GITHUB_TOKEN }}
22+
pypi_token: ${{ secrets.PYPI_TOKEN }}
23+
speakeasy_api_key: ${{ secrets.SPEAKEASY_API_KEY }}

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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
12+
.env
13+
.env.local

0 commit comments

Comments
 (0)