Skip to content

Commit a091c9e

Browse files
authored
feat: build, test, and package the Python SDK standalone (#3)
Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent ad06256 commit a091c9e

49 files changed

Lines changed: 12968 additions & 34 deletions

Some content is hidden

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

‎.gitattributes‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Generated protobuf bindings (committed; see README). GitHub collapses them
2+
# in diffs and leaves them out of language statistics. _proto/__init__.py is
3+
# hand-written and stays visible.
4+
src/openshell/_proto/*_pb2.py linguist-generated
5+
src/openshell/_proto/*_pb2.pyi linguist-generated
6+
src/openshell/_proto/*_pb2_grpc.py linguist-generated
7+
src/openshell/_proto/*_pb2_grpc.pyi linguist-generated

‎.github/CODEOWNERS‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# The sdk team owns the SDK; OpenShell maintainers review as a fallback.
4+
# An infra review for CI and the release scripts comes back with #15.
5+
* @ai-openshell/sdk @ai-openshell/maintainers
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
name: Bug Report
4+
description: Report unexpected behavior of the Python SDK with a clear user story and expected outcome.
5+
type: Bug
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
## Bug Reports
11+
12+
Describe who encountered the bug, the problem it creates, why it matters, and the observable criteria for a fix. Please check the latest `openshell` release on PyPI and search existing issues for possible duplicates before filing.
13+
14+
Problems with the gateway, CLI, or sandboxes belong in [NVIDIA/OpenShell](https://github.com/NVIDIA/OpenShell/issues). Do not report security vulnerabilities here; follow [SECURITY.md](https://github.com/ai-openshell/sdk-python/blob/main/SECURITY.md) instead.
15+
16+
- type: textarea
17+
id: user-story
18+
attributes:
19+
label: User Story
20+
description: Describe the specific use case and behavior you directly encountered or need.
21+
placeholder: |
22+
I use the OpenShell Python SDK for <specific use case>.
23+
I directly encountered or need <specific behavior>.
24+
This affects <outcome>.
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: problem
30+
attributes:
31+
label: Problem Statement
32+
description: Summarize what is broken in the SDK's current behavior. Describe its consequences and current workarounds in Impact / Why This Matters.
33+
placeholder: Describe the gap or failure in the SDK's current behavior and when it occurs.
34+
validations:
35+
required: true
36+
37+
- type: textarea
38+
id: impact
39+
attributes:
40+
label: Impact / Why This Matters
41+
description: |
42+
Explain how the bug affects users and what they must do to work around it today. Include evidence where available, but do not diagnose the cause or prescribe the fix.
43+
placeholder: |
44+
When this happens, users must...
45+
This results in...
46+
This matters because...
47+
validations:
48+
required: true
49+
50+
- type: textarea
51+
id: acceptance-criteria
52+
attributes:
53+
label: Acceptance Criteria
54+
description: List the specific, observable outcomes that would demonstrate the bug is fixed.
55+
placeholder: |
56+
- [ ] <observable outcome>
57+
- [ ] <observable outcome>
58+
validations:
59+
required: true
60+
61+
- type: textarea
62+
id: reproduction
63+
attributes:
64+
label: Reproduction Steps
65+
description: Provide a minimal Python snippet against an OpenShell gateway, and what you expected instead.
66+
placeholder: |
67+
from openshell import Sandbox
68+
69+
with Sandbox(...) as sb:
70+
...
71+
render: python
72+
validations:
73+
required: true
74+
75+
- type: textarea
76+
id: environment
77+
attributes:
78+
label: Environment
79+
description: Include the SDK, Python, and gateway versions.
80+
placeholder: |
81+
- openshell (SDK): 0.x.x (output of `python -c "import openshell; print(openshell.__version__)"`)
82+
- Python: 3.x.x
83+
- OpenShell gateway: v0.x.x, deployment mode and compute driver
84+
- OS: macOS 15.2 / Ubuntu 24.04 / Windows 11 + WSL2
85+
validations:
86+
required: true
87+
88+
- type: textarea
89+
id: logs
90+
attributes:
91+
label: Logs
92+
description: |
93+
Include the smallest relevant traceback, error message, or log excerpt.
94+
Redact credentials, API keys, tokens, and query parameters before pasting.
95+
render: shell
96+
validations:
97+
required: false

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
blank_issues_enabled: false
4+
contact_links:
5+
- name: Gateway, CLI, or sandbox problem?
6+
url: https://github.com/NVIDIA/OpenShell/issues/new/choose
7+
about: >
8+
This repository is the Python SDK only. Report problems with the
9+
OpenShell gateway, CLI, sandboxes, or the gRPC API in NVIDIA/OpenShell.
10+
- name: Security vulnerability?
11+
url: https://github.com/ai-openshell/sdk-python/blob/main/SECURITY.md
12+
about: >
13+
Do not report security vulnerabilities through GitHub issues. Follow
14+
SECURITY.md and use the private reporting form.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
name: Feature Request
4+
description: Propose an SDK feature with a user story and API design. Not a "please build this" request.
5+
type: Feature
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
## Design-First Feature Proposals
11+
12+
Describe who needs the feature, the problem it solves, why the current gap matters, the API you would like to use, and the observable criteria for success. Leave implementation choices to the people building the feature.
13+
14+
The SDK wraps the OpenShell gateway's API. A feature that needs a new gateway capability starts in [NVIDIA/OpenShell](https://github.com/NVIDIA/OpenShell/issues); link that issue here.
15+
16+
- type: textarea
17+
id: user-story
18+
attributes:
19+
label: User Story
20+
description: Describe the specific use case and behavior you directly encountered or need.
21+
placeholder: |
22+
I use the OpenShell Python SDK for <specific use case>.
23+
I directly encountered or need <specific behavior>.
24+
This affects <outcome>.
25+
validations:
26+
required: true
27+
28+
- type: textarea
29+
id: problem
30+
attributes:
31+
label: Problem Statement
32+
description: Summarize the capability missing from the SDK today. Describe its consequences and current workarounds in Impact / Why This Matters.
33+
validations:
34+
required: true
35+
36+
- type: textarea
37+
id: impact
38+
attributes:
39+
label: Impact / Why This Matters
40+
description: |
41+
Explain what users must do today and why that is insufficient, for example calling `openshell._proto` stubs directly. Include concrete evidence where available, but do not prescribe the implementation.
42+
placeholder: |
43+
Without this feature, users must...
44+
This results in...
45+
This matters because...
46+
validations:
47+
required: true
48+
49+
- type: textarea
50+
id: design
51+
attributes:
52+
label: Proposed API
53+
description: |
54+
How should this look to an SDK user? Show a notional Python example and describe the externally observable behavior.
55+
render: python
56+
validations:
57+
required: true
58+
59+
- type: textarea
60+
id: acceptance-criteria
61+
attributes:
62+
label: Acceptance Criteria
63+
description: List specific, observable outcomes that would make this feature complete without prescribing how implementers achieve them.
64+
placeholder: |
65+
- [ ] <observable outcome>
66+
- [ ] <observable outcome>
67+
validations:
68+
required: true
69+
70+
- type: textarea
71+
id: alternatives
72+
attributes:
73+
label: Alternatives Considered
74+
description: Explain what you tried with the current SDK, including the generated `openshell._proto` stubs, and why the proposal serves your use case better.
75+
validations:
76+
required: true
77+
78+
- type: checkboxes
79+
id: checklist
80+
attributes:
81+
label: Checklist
82+
options:
83+
- label: I've reviewed existing issues and the README
84+
required: true
85+
- label: This is a design proposal, not a "please build this" request
86+
required: true

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## Summary
2+
<!-- 1-3 sentences: what this PR does and why -->
3+
4+
## Related Issue
5+
<!-- Closes #NNN. Small fixes, dependency updates and core bump PRs may skip the issue; say why instead. -->
6+
7+
## Changes
8+
<!-- Bullet list of key changes. Call out changes to the public API (`openshell.__all__`) or to `openshell._proto`. -->
9+
10+
## Testing
11+
<!-- Report the verification you ran for this change. -->
12+
- [ ] `mise run ci` passes
13+
- [ ] Unit tests added/updated (if applicable)
14+
- [ ] E2E tests added/updated (if applicable)
15+
16+
## Checklist
17+
18+
- [ ] Follows [Conventional Commits](https://www.conventionalcommits.org/)
19+
- [ ] Commits are signed off (DCO)
20+
- [ ] README or CONTRIBUTING.md updated (if applicable)

‎.github/dependabot.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
version: 2
4+
updates:
5+
- package-ecosystem: "uv"
6+
directory: "/"
7+
schedule:
8+
interval: "weekly"
9+
cooldown:
10+
default-days: 7
11+
groups:
12+
python-minor-and-patch:
13+
update-types: ["minor", "patch"]
14+
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
schedule:
18+
interval: "daily"
19+
cooldown:
20+
default-days: 7

‎.github/workflows/ci.yml‎

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: ci
5+
6+
on:
7+
pull_request:
8+
push:
9+
branches: [main]
10+
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
14+
15+
concurrency:
16+
group: ci-${{ github.ref }}
17+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
18+
19+
jobs:
20+
checks:
21+
name: checks
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 15
24+
steps:
25+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26+
with:
27+
persist-credentials: false
28+
29+
- uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
30+
31+
# fetch-core.sh reads proto/ and sdk/conformance from NVIDIA/OpenShell
32+
# at the pinned ref (public, no credentials).
33+
- name: Format, lint, typecheck, proto and fixture drift
34+
run: mise run check
35+
36+
test:
37+
name: test (${{ matrix.python }})
38+
runs-on: ubuntu-latest
39+
timeout-minutes: 15
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
# Keep in sync with requires-python and the classifiers in pyproject.toml.
44+
python: ["3.11", "3.12", "3.13", "3.14"]
45+
env:
46+
UV_PYTHON: ${{ matrix.python }}
47+
steps:
48+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
49+
with:
50+
persist-credentials: false
51+
52+
- uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
53+
54+
- name: Unit tests
55+
run: mise run test
56+
57+
build:
58+
name: build
59+
runs-on: ubuntu-latest
60+
timeout-minutes: 15
61+
steps:
62+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
63+
with:
64+
persist-credentials: false
65+
# setuptools-scm reads the version from git history.
66+
fetch-depth: 0
67+
68+
- uses: jdx/mise-action@e6a8b3978addb5a52f2b4cd9d91eafa7f0ab959d # v4.2.0
69+
70+
- name: Build, verify, and install the wheel and sdist
71+
run: mise run build
72+
73+
# The one required status check. Its name matches ai-openshell/sdk-go, so
74+
# rulesets can require `ci` in every SDK repository regardless of the jobs
75+
# each one runs.
76+
ci:
77+
name: ci
78+
if: always()
79+
needs: [checks, test, build]
80+
runs-on: ubuntu-latest
81+
timeout-minutes: 5
82+
steps:
83+
- name: Require every job to succeed
84+
env:
85+
RESULTS: ${{ join(needs.*.result, ' ') }}
86+
run: |
87+
for result in $RESULTS; do
88+
if [ "$result" != success ]; then
89+
echo "::error::a required job finished with '$result' ($RESULTS)"
90+
exit 1
91+
fi
92+
done

‎.github/workflows/codeql.yml‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
name: CodeQL
4+
5+
on:
6+
pull_request:
7+
push:
8+
branches: [main]
9+
schedule:
10+
- cron: "29 5 * * 1"
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
16+
concurrency:
17+
group: codeql-${{ github.ref }}
18+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
19+
20+
jobs:
21+
analyze:
22+
name: CodeQL (python)
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 30
25+
permissions:
26+
contents: read
27+
security-events: write
28+
steps:
29+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
30+
with:
31+
persist-credentials: false
32+
33+
# Python needs no build. The generated bindings are left out.
34+
- name: Initialize CodeQL
35+
uses: github/codeql-action/init@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
36+
with:
37+
languages: python
38+
build-mode: none
39+
config: |
40+
paths-ignore:
41+
- src/openshell/_proto
42+
43+
- name: Analyze
44+
uses: github/codeql-action/analyze@24c54180a607b1449ed407dd24f251e4e9147c8d # v4.38.3
45+
with:
46+
category: /language:python

0 commit comments

Comments
 (0)