Skip to content

Commit 0cfbf13

Browse files
authored
chore: add the repository basics from sdk-go
AGENTS.md, CONTRIBUTING.md and SECURITY.md describe this repository's tasks, conventions and reporting path. CODEOWNERS gives the SDK to the sdk team, with maintainers as fallback and infra for CI. Dependabot updates the uv lockfile weekly and actions daily, and CodeQL scans the Python sources, without the generated bindings. Signed-off-by: Piotr Mlocek <pmlocek@nvidia.com>
1 parent b75203f commit 0cfbf13

7 files changed

Lines changed: 184 additions & 1 deletion

File tree

‎.github/CODEOWNERS‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# The sdk team owns the SDK; OpenShell maintainers review as a fallback.
4+
* @ai-openshell/sdk @ai-openshell/maintainers
5+
6+
# CI needs an infra review.
7+
/.github/ @ai-openshell/infra

‎.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/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

‎AGENTS.md‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Agent Instructions
2+
3+
The OpenShell Python SDK: package `openshell` on PyPI, a client for the
4+
OpenShell gateway. See [CONTRIBUTING.md](CONTRIBUTING.md) for tasks and the
5+
release model.
6+
7+
## Commands
8+
9+
- `mise run ci` runs the full pipeline (format check, lint, type check, proto
10+
check, conformance check, unit tests, build).
11+
- `mise run proto:gen` regenerates `src/openshell/_proto` from core at the ref
12+
pinned in `OPENSHELL_CORE_REF` (`mise.toml`). Never edit generated files by
13+
hand.
14+
- Use `uv` for Python commands (`uv run`, `uv sync`), never `pip` directly.
15+
16+
## Code conventions
17+
18+
- The SDK supports Python 3.11 and newer. Don't use syntax or standard library
19+
features from later versions.
20+
- The public API is what `openshell/__init__.py` exports in `__all__`. Users
21+
also import `openshell._proto` directly, so keep its module paths stable.
22+
- Unit tests live in `tests/` and are named `*_test.py`; fixtures go in
23+
`tests/fixtures/`.
24+
- Files copied from core must stay identical to core at the pin;
25+
`mise run conformance:check` compares them.
26+
- New files need only the license line `SPDX-License-Identifier: Apache-2.0`
27+
in a comment. Keep the existing headers as they are.
28+
29+
## Commits
30+
31+
- Use Conventional Commits and sign off every commit (`--signoff`).
32+
- Never mention Claude or any AI agent in commits, pull request descriptions, or
33+
issues (no author attribution, no Co-Authored-By, no "Generated with"
34+
footers).

‎CONTRIBUTING.md‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Contributing to the OpenShell Python SDK
2+
3+
## Setup
4+
5+
Install [mise](https://mise.jdx.dev/), then install the pinned tools and the
6+
development dependencies:
7+
8+
```shell
9+
mise install
10+
mise run sync
11+
```
12+
13+
mise reads the Python version from `.python-version`, and uv manages the
14+
virtual environment. `mise tasks` lists every task. The ones you need most:
15+
16+
| Task | What it does |
17+
|------|--------------|
18+
| `mise run ci` | Everything CI runs: checks, unit tests, build |
19+
| `mise run check` | Format check, lint, type check, proto check, conformance check |
20+
| `mise run format` | Format the code |
21+
| `mise run test` | Unit tests; `UV_PYTHON=3.11` picks the interpreter |
22+
| `mise run build` | Build the wheel and sdist, verify them, and install them on Python 3.11 |
23+
| `mise run proto:gen` | Regenerate the bindings from core at the pinned ref |
24+
| `mise run core:version` | Print the pinned core version |
25+
26+
CI runs the unit tests on every Python version the package supports (3.11 to
27+
3.14).
28+
29+
## Commits and pull requests
30+
31+
- Use [Conventional Commits](https://www.conventionalcommits.org/):
32+
`<type>(<scope>): <description>`.
33+
- Sign off every commit (`git commit --signoff`) for the [Developer Certificate
34+
of Origin](https://developercertificate.org/).
35+
- Every change goes through a pull request with an approval from a code owner
36+
who did not push last.
37+
- New files need only the license line `SPDX-License-Identifier: Apache-2.0`
38+
in a comment. Keep the existing headers as they are.
39+
40+
## Bindings and core versions
41+
42+
The bindings in `src/openshell/_proto` are generated from core's `proto/` at one
43+
core ref, `OPENSHELL_CORE_REF` in `mise.toml`, and committed. Don't edit
44+
generated files; change the pin and run `mise run proto:gen`.
45+
`mise run proto:check` fails when the committed bindings don't match the pin.
46+
47+
Shared test fixtures come from core's `sdk/conformance/` and are copied into
48+
`tests/fixtures/`. `mise run conformance:check` compares them with core at the
49+
pinned ref.
50+
51+
## Releases
52+
53+
SDK releases follow core releases: SDK `X.Y.Z` is built from core `vX.Y.Z`, and
54+
there are no SDK-only releases. To try unreleased changes, install from the
55+
repository:
56+
57+
```shell
58+
pip install "openshell @ git+https://github.com/ai-openshell/sdk-python@main"
59+
```

‎README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ NVIDIA/OpenShell stay on PyPI.
1717

1818
Tools are managed by [mise](https://mise.jdx.dev/) and dependencies by
1919
[uv](https://docs.astral.sh/uv/). The Python version is pinned in
20-
`.python-version`, which both read.
20+
`.python-version`, which both read. See [CONTRIBUTING.md](CONTRIBUTING.md) for
21+
setup, commit rules and the release model, and [SECURITY.md](SECURITY.md) to
22+
report a vulnerability.
2123

2224
```shell
2325
mise run ci # checks, tests, build, and install smoke test

‎SECURITY.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Security Policy
2+
3+
## Reporting a vulnerability
4+
5+
Report vulnerabilities in the OpenShell Python SDK privately through
6+
[NVIDIA/OpenShell's private reporting
7+
form](https://github.com/NVIDIA/OpenShell/security/advisories/new) and name
8+
`ai-openshell/sdk-python` as the affected component. Do not disclose
9+
vulnerabilities in public issues, discussions, or pull requests.
10+
11+
The OpenShell security policy applies to this repository: the [report template,
12+
review process, and coordinated
13+
disclosure](https://github.com/NVIDIA/OpenShell/blob/main/SECURITY.md) are the
14+
same. Private reporting directly on this repository will be enabled once its
15+
process is set up; until then, use the form above.

0 commit comments

Comments
 (0)