diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml new file mode 100644 index 0000000..10f6dbe --- /dev/null +++ b/.github/workflows/publish-pypi.yml @@ -0,0 +1,51 @@ +name: publish-pypi + +on: + workflow_dispatch: + push: + tags: + - "v*" + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Build distribution + run: | + python -m pip install --upgrade pip + python -m pip install build + python -m build + + - name: Upload dist artifact + uses: actions/upload-artifact@v4 + with: + name: python-dist + path: dist/ + + publish: + runs-on: ubuntu-latest + needs: build + permissions: + contents: read + steps: + - name: Download dist artifact + uses: actions/download-artifact@v4 + with: + name: python-dist + path: dist/ + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} + skip-existing: true diff --git a/README.md b/README.md index cac975d..a0e3268 100644 --- a/README.md +++ b/README.md @@ -22,9 +22,10 @@ The AXME Python SDK gives you a fully typed client for the AXME platform. You ca ## Install ```bash -pip install axme-sdk +python -m pip install "git+https://github.com/AxmeAI/axme-sdk-python.git" ``` +PyPI publication target: `axme` (pending registry credentials and first public release). For local development from source: ```bash @@ -118,11 +119,18 @@ for event in client.observe(intent["intent_id"]): ```python # Fetch pending approvals for an agent -pending = client.list_inbox({"owner_agent": "agent://manager", "status": "PENDING"}) - -for item in pending["items"]: - # Approve with a note - client.resolve_approval(item["intent_id"], {"decision": "approved", "note": "LGTM"}) +pending = client.list_inbox(owner_agent="agent://manager") + +for item in pending.get("items", []): + thread_id = item.get("thread_id") + if not thread_id: + continue + # Approve the inbox thread with a note + client.approve_inbox_thread( + thread_id, + {"note": "LGTM"}, + owner_agent="agent://manager", + ) ``` --- diff --git a/pyproject.toml b/pyproject.toml index 1c4c774..ed329be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["hatchling>=1.25.0"] build-backend = "hatchling.build" [project] -name = "axme-sdk" +name = "axme" version = "0.1.0" description = "Official Python SDK for Axme APIs." readme = "README.md" @@ -15,5 +15,8 @@ dependencies = ["httpx>=0.27.0,<1.0.0"] [project.optional-dependencies] dev = ["pytest>=9.0.0,<10.0.0"] +[tool.hatch.build.targets.wheel] +packages = ["axme_sdk"] + [tool.pytest.ini_options] testpaths = ["tests"]