Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python bindings initial feature set #602

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
be3c09b
Limited prototype of Python bindings (#56)
smartgoo Jun 28, 2024
9f0ce64
add proc macro scaffolding for python wRPC client methods (#57)
aspect Jun 28, 2024
7a812b5
General purpose python macros (#58)
aspect Jun 28, 2024
6941ae5
Python dict type for RPC method arg/return values (#60)
smartgoo Jul 2, 2024
cef3a52
Python wRPC client subscription prototype (#62)
smartgoo Jul 12, 2024
591c9b0
Resolver for Python wRPC client prototype (#70)
smartgoo Jul 21, 2024
fc710ad
Python .pyi file example for type hints/editor completion (#72)
cafalchio Jul 21, 2024
e1662be
Expose kaspa-wallet-keys structs to Python (#84)
smartgoo Aug 8, 2024
f26ba18
Limited prototype of Python bindings (#56)
smartgoo Jun 28, 2024
6f45aed
add proc macro scaffolding for python wRPC client methods (#57)
aspect Jun 28, 2024
6c0e2a7
General purpose python macros (#58)
aspect Jun 28, 2024
010d72b
Python dict type for RPC method arg/return values (#60)
smartgoo Jul 2, 2024
f42d63c
Python wRPC client subscription prototype (#62)
smartgoo Jul 12, 2024
a40a0db
Resolver for Python wRPC client prototype (#70)
smartgoo Jul 21, 2024
676a51e
Python .pyi file example for type hints/editor completion (#72)
cafalchio Jul 21, 2024
ea369e0
Expose kaspa-wallet-keys structs to Python (#84)
smartgoo Aug 8, 2024
5784cde
lock
smartgoo Sep 21, 2024
86dfbf4
RPC & resolver omega updates
smartgoo Aug 28, 2024
4a5bc3d
publickey py method block
smartgoo Sep 21, 2024
ba0ebc6
Merge branch 'python' into python-0.15.2
smartgoo Sep 21, 2024
90d7dab
Remove duplicate unindent from Cargo.lock
smartgoo Sep 21, 2024
b5bb8d3
fmt
smartgoo Sep 21, 2024
7bb40c7
Merge pull request #101 from smartgoo/python-0.15.2
smartgoo Sep 21, 2024
d6ccd2a
Python binding updates (#103)
smartgoo Sep 21, 2024
c41b17c
mnemonic to python (#104)
smartgoo Sep 22, 2024
a1ab06f
ScriptBuilder (#108)
smartgoo Oct 15, 2024
399b698
Python Tx Generator (#109)
smartgoo Oct 24, 2024
5d48525
remove rpc _call suffix in .pyi (#110)
smartgoo Oct 25, 2024
866e739
README update (#111)
smartgoo Oct 26, 2024
bdc2198
PyBinary interface type (#112)
smartgoo Oct 26, 2024
f8128e7
Bug fix **kwargs requirement in RPC callback fn (#113)
smartgoo Oct 26, 2024
676fd9d
Sompi/Kaspa conversion utils (#114)
smartgoo Oct 26, 2024
7979002
Clean up Python interface for NetworkId, NetworkType (#115)
smartgoo Oct 27, 2024
480526d
Python example cleanup & bug fix (#116)
smartgoo Oct 27, 2024
ef8e872
Python message signing (#117)
smartgoo Oct 27, 2024
fe65a1c
Python wallet tx mass and estimate functions (#118)
smartgoo Oct 27, 2024
2081aff
Python Transaction Examples (#119)
smartgoo Oct 27, 2024
b2cbfae
Pyo3 0.22.5 (#120)
smartgoo Nov 2, 2024
c5266f5
Python wallet signer functions (#121)
smartgoo Nov 3, 2024
4770a70
Py interface cleanup (#122)
smartgoo Nov 3, 2024
8d563a1
Expose consensus client util functions to Python (#123)
smartgoo Nov 9, 2024
6e2c380
Bindings dirs (#124)
smartgoo Nov 16, 2024
990472d
Python Cleanup (#125)
smartgoo Nov 17, 2024
48c64fd
CI (#126)
smartgoo Nov 20, 2024
71e32af
Merge branch 'master' into py-rb
smartgoo Nov 21, 2024
263e5b4
Cargo.lock
smartgoo Nov 21, 2024
d44cbbc
bindings signer layout
smartgoo Nov 22, 2024
955f7dc
python module version
smartgoo Nov 22, 2024
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
19 changes: 19 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -404,3 +404,22 @@ jobs:
source musl-toolchain/build.sh
# Build for musl
cargo --verbose build --bin kaspad --bin rothschild --bin kaspa-wallet --release --target x86_64-unknown-linux-musl

build-python-sdk:
name: Build Python SDK
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: python
target: x86_64
args: --release --strip --out target/dist --features py-sdk --interpreter python3.12
manylinux: auto
82 changes: 82 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,85 @@ jobs:
asset_path: "./${{ env.archive }}"
asset_name: "${{ env.asset_name }}"
asset_content_type: application/zip

build-python-sdk:
name: Building Python SDK
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
platform:
- runner: ubuntu-latest
target: x86_64
manylinux: auto
- runner: ubuntu-latest
target: aarch64
# ring crate 0.17 fails to build for aarch64 using manylinux: auto, hence manylinux_2_28
manylinux: manylinux_2_28
- runner: macos-latest
target: x86_64-apple-darwin
- runner: macos-latest
target: aarch64-apple-darwin
- runner: windows-latest
target: x64
- runner: windows-latest
target: x86
steps:
- name: Checkout sources
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '>=3.10 <3.13'

- name: Install cross-compilation tools (Linux only)
if: runner.os == 'Linux' && matrix.platform.target != 'x86_64'
run: |
sudo apt-get update
if [ "${{ matrix.platform.target }}" == "aarch64" ]; then
sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
echo "CC=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
elif [ "${{ matrix.platform.target }}" == "armv7" ]; then
sudo apt-get install -y gcc-arm-linux-gnueabihf
echo "CC=arm-linux-gnueabihf-gcc" >> $GITHUB_ENV
fi

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
working-directory: python
target: ${{ matrix.platform.target }}
args: --release --strip --out target/dist --features py-sdk --interpreter python3.10 python3.11 python3.12
sccache: 'true'
manylinux: ${{ matrix.platform.manylinux || '' }}

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}-${{ matrix.platform.target }}
path: python/target/dist/

collect-python-sdk-artifacts:
name: Collect Python SDK Artifacts
needs: build-python-sdk
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts

- name: Zip artifacts
run: |
cd artifacts
sudo zip -r ../kaspa-python-sdk.zip .

- name: Upload consolidated release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./kaspa-python-sdk.zip
asset_name: "kaspa-python-sdk-${{ github.event.release.tag_name }}.zip"
asset_content_type: application/zip

Loading