Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: uv sync --all-extras --dev

- name: Run Tests
run: uv run pytest
run: uv run python scripts/run_pytest.py

lint-python:
runs-on: ubuntu-latest
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/publish_npm_x402_tron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish @bankofai/x402-tron package to NPM

on:
workflow_dispatch:

jobs:
publish-npm-x402-tron:
runs-on: ubuntu-latest
environment: ${{ github.ref == 'refs/heads/main' && 'npm' || '' }}
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

- name: Setup pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
with:
version: 10.7.0

- uses: actions/setup-node@v4
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
cache: "pnpm"
cache-dependency-path: ./typescript

- name: Update npm for OIDC trusted publishing
run: npm install -g npm@latest

- name: Configure npm for trusted publishing
run: npm config delete always-auth 2>/dev/null || true

- name: Install and build
working-directory: ./typescript
run: |
pnpm install --frozen-lockfile
pnpm -r --filter=@bankofai/x402-core --filter=@bankofai/x402-tron run build

- name: Publish @bankofai/x402-tron package
working-directory: ./typescript/packages/mechanisms/tron
run: |
PACKAGE_NAME=$(node -p "require('./package.json').name")
PACKAGE_VERSION=$(node -p "require('./package.json').version")

echo "Package: $PACKAGE_NAME@$PACKAGE_VERSION"

if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "Publishing to NPM (main branch)"
pnpm publish --provenance --access public
else
echo "Dry run only (non-main branch: ${{ github.ref }})"
pnpm publish --dry-run --no-git-checks
fi
38 changes: 38 additions & 0 deletions python/x402/scripts/run_pytest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env python3

from __future__ import annotations

import importlib.machinery
import os
import platform
import sys
import types

import pytest


def _install_readline_stub() -> None:
"""Avoid macOS uv/readline crashes when pytest imports readline during startup."""
if platform.system() != "Darwin":
return
if "readline" in sys.modules:
return

stub = types.ModuleType("readline")
stub.__spec__ = importlib.machinery.ModuleSpec("readline", loader=None)
stub.get_current_history_length = lambda: 0
stub.get_history_item = lambda _index: None
stub.read_history_file = lambda *_args, **_kwargs: None
stub.write_history_file = lambda *_args, **_kwargs: None
stub.parse_and_bind = lambda *_args, **_kwargs: None
sys.modules["readline"] = stub


def main() -> int:
_install_readline_stub()
return pytest.main(sys.argv[1:] or ["-q"])


if __name__ == "__main__":
os.environ.setdefault("PYTHONIOENCODING", "utf-8")
raise SystemExit(main())
97 changes: 95 additions & 2 deletions python/x402/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions typescript/packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bankofai/x402-core",
"version": "2.6.0",
"version": "2.6.0-beta.1",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/cjs/index.d.ts",
Expand All @@ -19,7 +19,10 @@
"keywords": [],
"license": "Apache-2.0",
"author": "bankofai",
"repository": "https://github.com/bankofai/x402",
"repository": {
"type": "git",
"url": "git+https://github.com/BofAI/x402.git"
},
"description": "x402 Payment Protocol",
"devDependencies": {
"@eslint/js": "^9.24.0",
Expand Down
7 changes: 5 additions & 2 deletions typescript/packages/extensions/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bankofai/x402-extensions",
"version": "2.6.0",
"version": "2.6.0-beta.1",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/cjs/index.d.ts",
Expand All @@ -23,7 +23,10 @@
],
"license": "Apache-2.0",
"author": "bankofai",
"repository": "https://github.com/bankofai/x402",
"repository": {
"type": "git",
"url": "git+https://github.com/BofAI/x402.git"
},
"description": "x402 Payment Protocol Extensions",
"devDependencies": {
"@eslint/js": "^9.24.0",
Expand Down
5 changes: 4 additions & 1 deletion typescript/packages/http/axios/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
"keywords": [],
"license": "Apache-2.0",
"author": "bankofai",
"repository": "https://github.com/bankofai/x402",
"repository": {
"type": "git",
"url": "git+https://github.com/BofAI/x402.git"
},
"description": "x402 Payment Protocol",
"devDependencies": {
"@eslint/js": "^9.24.0",
Expand Down
5 changes: 4 additions & 1 deletion typescript/packages/http/express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
"keywords": [],
"license": "Apache-2.0",
"author": "bankofai",
"repository": "https://github.com/bankofai/x402",
"repository": {
"type": "git",
"url": "git+https://github.com/BofAI/x402.git"
},
"description": "x402 Payment Protocol",
"devDependencies": {
"@eslint/js": "^9.24.0",
Expand Down
7 changes: 5 additions & 2 deletions typescript/packages/http/fetch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bankofai/x402-fetch",
"version": "2.6.0",
"version": "2.6.0-beta.1",
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -18,7 +18,10 @@
"keywords": [],
"license": "Apache-2.0",
"author": "bankofai",
"repository": "https://github.com/bankofai/x402",
"repository": {
"type": "git",
"url": "git+https://github.com/BofAI/x402.git"
},
"description": "x402 Payment Protocol Fetch Extension",
"devDependencies": {
"@eslint/js": "^9.24.0",
Expand Down
Loading
Loading