Skip to content

refactor: split into typescript/ + python/ monorepo, add Python sibling package#12

Merged
acedatacloud-dev merged 1 commit intomainfrom
refactor/monorepo-ts-python
Apr 19, 2026
Merged

refactor: split into typescript/ + python/ monorepo, add Python sibling package#12
acedatacloud-dev merged 1 commit intomainfrom
refactor/monorepo-ts-python

Conversation

@acedatacloud-dev
Copy link
Copy Markdown
Member

Why

Feature parity with @acedatacloud/sdk, which ships both a TypeScript and
a Python package. The x402 plugin should have the same coverage.

What

Split this repo into a monorepo:

typescript/    @acedatacloud/x402-client (moved; build & scripts intact)
python/        acedatacloud-x402          (new, PyPI-ready)

Python package

  • src/acedatacloud_x402/
    • handler.pycreate_x402_payment_handler(network=..., evm_signer=..., solana_signer=...) returns a callable the SDK invokes on 402.
    • types.py — TypedDicts mirroring typescript/src/types.ts.
    • signing/evm.py — EIP-3009 TransferWithAuthorization via eth_account (no web3.py dep).
    • signing/solana.py — SPL TransferChecked builder + httpx JSON-RPC client (no solana-py dep, just solders).
  • Works with both acedatacloud.AceDataCloud(payment_handler=...) and AsyncAceDataCloud.
  • hatchling build, pytest-asyncio, ruff (check + format).

CI

  • ci.yml: two jobs — TypeScript build, Python 3.10/3.11/3.12 lint+test — each with its own working-directory.
  • publish.yml: scoped to typescript/ (CalVer YYYY.M.D[.N] → npm), unchanged logic.
  • publish-pypi.yml (new): CalVer YYYY.M.D[.N] → PyPI via pypa trusted publishing.

Verified locally

Check Result
cd typescript && npm run build OK
cd python && ruff check . 0 errors
cd python && ruff format --check . OK
cd python && pytest -q 7 passed

Follow-ups (not in this PR)

  • Publish the first Python release (will happen automatically on merge).
  • Add live Solana/Base e2e scripts for Python (nice-to-have; not blocking — real on-chain coverage already exists on the TS side).

…ibling

Mirrors the AceDataCloud/SDK layout so the x402 plugin has feature
parity across TS and Python.

Structure:
  typescript/    @acedatacloud/x402-client (moved, build and scripts intact)
  python/        acedatacloud-x402 (new, PyPI-ready)

Python package:
- src/acedatacloud_x402/{handler.py, types.py, signing/{evm.py,solana.py}}
- create_x402_payment_handler() returns a callable compatible with
  acedatacloud.AceDataCloud(payment_handler=...) (sync and async)
- EVMAccountSigner wraps eth_account.Account (no web3.py dep)
- SolanaKeypairSigner wraps solders.Keypair (no solana-py dep)
- ships its own SPL TransferChecked builder + httpx JSON-RPC client,
  mirroring the TS reference implementation
- hatchling build, pytest-asyncio, ruff (check + format) — all green

CI:
- .github/workflows/ci.yml: two jobs (typescript build, python 3.10/3.11/3.12
  lint + test) with working-directory set per-job
- .github/workflows/publish.yml: scoped to typescript/, unchanged CalVer logic
- .github/workflows/publish-pypi.yml (new): CalVer-versioned PyPI publish
  mirroring publish.yml; uses Trusted Publishing via pypa/gh-action-pypi-publish

Docs: root README is a monorepo landing page linking to typescript/ and
python/; language-specific READMEs live in the subfolders.

Verified locally:
  cd typescript && npm run build          → OK
  cd python && ruff check . && ruff format --check . && pytest -q → 7 passed
@acedatacloud-dev acedatacloud-dev merged commit 456e1c5 into main Apr 19, 2026
4 checks passed
@acedatacloud-dev acedatacloud-dev deleted the refactor/monorepo-ts-python branch April 19, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant