Skip to content

Commit cf6d3da

Browse files
nadavisclaude
andcommitted
feat: initial Python SDK release v0.2.0
- @Protect decorator with async support - HTTP client with cwd + agent context - ActionDeniedException with negotiation property - NODE9_AUTO_START opt-in daemon auto-start - Apache-2.0 license - CI/CD workflows for pytest and PyPI auto-release - E2E test script Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ad2c79a commit cf6d3da

22 files changed

+1610
-22
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Report a bug or unexpected behavior
4+
title: '[Bug] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Description
10+
11+
A clear and concise description of the bug.
12+
13+
## Steps to reproduce
14+
15+
1. Run `node9 ...`
16+
2. Configure `node9.config.json` with ...
17+
3. Observe ...
18+
19+
## Expected behavior
20+
21+
What you expected to happen.
22+
23+
## Actual behavior
24+
25+
What actually happened. Include any error output.
26+
27+
## Environment
28+
29+
- Node9 version (`node9 --version`):
30+
- Node.js version (`node --version`):
31+
- OS:
32+
- AI agent (Claude Code / Gemini CLI / Cursor / other):
33+
34+
## Additional context
35+
36+
Any other context, logs, or screenshots.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea or enhancement
4+
title: '[Feature] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Problem
10+
11+
What problem does this solve? Is your feature request related to a frustration you have?
12+
13+
## Proposed solution
14+
15+
A clear description of what you want to happen.
16+
17+
## Alternatives considered
18+
19+
Any alternative solutions or features you've considered.
20+
21+
## Additional context
22+
23+
Any other context, mockups, or examples.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
## Summary
2+
3+
What does this PR do? Reference any related issues (e.g. `Closes #123`).
4+
5+
## Type of change
6+
7+
- [ ] Bug fix
8+
- [ ] New feature
9+
- [ ] Refactor / code cleanup
10+
- [ ] Documentation
11+
- [ ] Tests
12+
13+
## Checklist
14+
15+
- [ ] `npm test` passes
16+
- [ ] `npm run typecheck` passes
17+
- [ ] `npm run lint` passes
18+
- [ ] Tests added/updated for new behavior
19+
- [ ] CHANGELOG.md updated (for user-facing changes)

.github/workflows/auto-pr.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Auto PR dev -> main
2+
3+
on:
4+
push:
5+
branches: [dev]
6+
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
11+
jobs:
12+
open-pr:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Open PR dev -> main if not exists
18+
env:
19+
GH_TOKEN: ${{ secrets.AUTO_PR_TOKEN }}
20+
PR_BODY: |
21+
### Auto-generated PR
22+
Merge latest `dev` changes into `main` to trigger a release.
23+
24+
> **⚠️ Important:** When you click Squash and Merge, ensure the commit message starts with:
25+
> - `fix:` to publish a Patch release (0.0.X)
26+
> - `feat:` to publish a Minor release (0.X.0)
27+
> If it starts with `chore:`, no PyPI package will be published!
28+
run: |
29+
PR=$(gh pr list --base main --head dev --state open --json number -q '.[0].number')
30+
if [ -z "$PR" ]; then
31+
gh pr create \
32+
--base main \
33+
--head dev \
34+
--title "fix: merge latest dev updates into main" \
35+
--body "$PR_BODY"
36+
echo "PR created."
37+
else
38+
echo "PR #$PR already open, skipping."
39+
fi

.github/workflows/ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
name: Test (Python ${{ matrix.python-version }})
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
python-version: ["3.10", "3.11", "3.12"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python ${{ matrix.python-version }}
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Install dependencies
27+
run: pip install pytest
28+
29+
- name: Run tests
30+
run: pytest tests/ -q
31+
32+
e2e:
33+
name: E2E
34+
runs-on: ubuntu-latest
35+
needs: test
36+
37+
steps:
38+
- uses: actions/checkout@v4
39+
40+
- name: Set up Python
41+
uses: actions/setup-python@v5
42+
with:
43+
python-version: "3.12"
44+
45+
- name: Install package
46+
run: pip install -e .
47+
48+
- name: Run E2E tests
49+
run: bash scripts/e2e.sh

.github/workflows/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write # create tags + commits
9+
pull-requests: write # comment on PRs
10+
id-token: write # PyPI trusted publishing
11+
12+
jobs:
13+
release:
14+
name: Semantic Release
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0 # full history so semantic-release can walk commits
20+
persist-credentials: false
21+
22+
- uses: actions/setup-python@v5
23+
with:
24+
python-version: "3.12"
25+
26+
- name: Install dependencies
27+
run: pip install pytest build python-semantic-release
28+
29+
- name: Run tests
30+
run: pytest tests/ -q
31+
32+
- name: Release
33+
env:
34+
GH_TOKEN: ${{ secrets.AUTO_PR_TOKEN }}
35+
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
36+
run: |
37+
git config user.name "github-actions[bot]"
38+
git config user.email "github-actions[bot]@users.noreply.github.com"
39+
semantic-release version
40+
semantic-release publish

0 commit comments

Comments
 (0)