Skip to content

Commit c2b5238

Browse files
chore: sync repo
1 parent 1fc47ea commit c2b5238

261 files changed

Lines changed: 46742 additions & 1 deletion

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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ARG VARIANT="3.9"
2+
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}
3+
4+
USER vscode
5+
6+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
7+
8+
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": "uv sync --all-extras",
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": "${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: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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/keycard-api-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
21+
steps:
22+
- uses: actions/checkout@v6
23+
24+
- name: Install uv
25+
uses: astral-sh/setup-uv@v5
26+
with:
27+
version: '0.10.2'
28+
29+
- name: Install dependencies
30+
run: uv sync --all-extras
31+
32+
- name: Run lints
33+
run: ./scripts/lint
34+
35+
build:
36+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
37+
timeout-minutes: 10
38+
name: build
39+
permissions:
40+
contents: read
41+
id-token: write
42+
runs-on: ${{ github.repository == 'stainless-sdks/keycard-api-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
43+
steps:
44+
- uses: actions/checkout@v6
45+
46+
- name: Install uv
47+
uses: astral-sh/setup-uv@v5
48+
with:
49+
version: '0.10.2'
50+
51+
- name: Install dependencies
52+
run: uv sync --all-extras
53+
54+
- name: Run build
55+
run: uv build
56+
57+
- name: Get GitHub OIDC Token
58+
if: |-
59+
github.repository == 'stainless-sdks/keycard-api-python' &&
60+
!startsWith(github.ref, 'refs/heads/stl/')
61+
id: github-oidc
62+
uses: actions/github-script@v8
63+
with:
64+
script: core.setOutput('github_token', await core.getIDToken());
65+
66+
- name: Upload tarball
67+
if: |-
68+
github.repository == 'stainless-sdks/keycard-api-python' &&
69+
!startsWith(github.ref, 'refs/heads/stl/')
70+
env:
71+
URL: https://pkg.stainless.com/s
72+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
73+
SHA: ${{ github.sha }}
74+
run: ./scripts/utils/upload-artifact.sh
75+
76+
test:
77+
timeout-minutes: 10
78+
name: test
79+
runs-on: ${{ github.repository == 'stainless-sdks/keycard-api-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
80+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
81+
steps:
82+
- uses: actions/checkout@v6
83+
84+
- name: Install uv
85+
uses: astral-sh/setup-uv@v5
86+
with:
87+
version: '0.10.2'
88+
89+
- name: Bootstrap
90+
run: ./scripts/bootstrap
91+
92+
- name: Run tests
93+
run: ./scripts/test

.github/workflows/publish-pypi.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +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/keycardai/keycard-python/actions/workflows/publish-pypi.yml
4+
name: Publish PyPI
5+
on:
6+
workflow_dispatch:
7+
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
publish:
13+
name: publish
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
id-token: write
18+
19+
steps:
20+
- uses: actions/checkout@v6
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v5
24+
with:
25+
version: '0.9.13'
26+
27+
- name: Publish to PyPI
28+
run: |
29+
bash ./bin/publish-pypi
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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 == 'keycardai/keycard-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@v6
16+
17+
- name: Check release environment
18+
run: |
19+
bash ./bin/check-release-environment

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.prism.log
2+
_dev
3+
4+
__pycache__
5+
.mypy_cache
6+
7+
dist
8+
9+
.venv
10+
.idea
11+
12+
.env
13+
.envrc
14+
codegen.log
15+
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"
3+
}

.stats.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
configured_endpoints: 87
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/keycard%2Fkeycard-api-99b3994c0eb51056133252ca79541cf8ae18807f82068a3ab773fed580b06a23.yml
3+
openapi_spec_hash: 62be9e140a7bd9f41e2343f232efb832
4+
config_hash: 8d67ced49c86832a6ec4b0c6fa8e6b40

.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)