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/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -425,5 +425,5 @@ jobs:
with:
working-directory: python
target: x86_64
args: --release --strip --out target/dist --features py-sdk --interpreter python3.12
args: --release --strip --out target/dist --interpreter python3.12
manylinux: auto
51 changes: 39 additions & 12 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ jobs:
asset_name: "${{ env.asset_name }}"
asset_content_type: application/zip

build-python-sdk:
name: Building Python SDK
build-python-sdk-wheels:
name: Building Python SDK Wheels
runs-on: ${{ matrix.platform.runner }}
strategy:
matrix:
Expand All @@ -213,20 +213,20 @@ jobs:
# 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
target: x86_64
- runner: macos-latest
target: aarch64-apple-darwin
- runner: windows-latest
target: x64
target: aarch64
- runner: windows-latest
target: x86
target: x86_64
# - 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'
python-version: '>=3.10 <=3.13'

- name: Install cross-compilation tools (Linux only)
if: runner.os == 'Linux' && matrix.platform.target != 'x86_64'
Expand All @@ -245,19 +245,46 @@ jobs:
with:
working-directory: python
target: ${{ matrix.platform.target }}
args: --release --strip --out target/dist --features py-sdk --interpreter python3.10 python3.11 python3.12
args: --release --strip --out target/dist --interpreter python3.10 python3.11 python3.12 python3.13
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/

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

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

- name: Build sdist
uses: PyO3/maturin-action@v1
with:
working-directory: python
command: sdist
args: --out target/dist
sccache: 'true'

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: sdist
path: python/target/dist/kaspa-*.tar.gz

collect-python-sdk-artifacts:
name: Collect Python SDK Artifacts
needs: build-python-sdk
needs:
- build-python-sdk-wheels
- build-python-sdk-sdist
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
Expand All @@ -268,7 +295,7 @@ jobs:
- name: Zip artifacts
run: |
cd artifacts
sudo zip -r ../kaspa-python-sdk.zip .
zip -r ../kaspa-python-sdk.zip .

- name: Upload consolidated release asset
uses: actions/upload-release-asset@v1
Expand Down
2 changes: 1 addition & 1 deletion python/build-dev
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ else
maturin --version
fi

BUILD_CMD="maturin develop --target-dir ./target --features py-sdk"
BUILD_CMD="maturin develop --target-dir target"
echo "Building with command '$BUILD_CMD'"
$BUILD_CMD

Expand Down
2 changes: 1 addition & 1 deletion python/build-release
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ else
maturin --version
fi

BUILD_CMD="maturin build --release --strip --sdist --target-dir target --out target/wheels --features py-sdk"
BUILD_CMD="maturin build --release --strip --sdist --target-dir target --out target/wheels"
echo "Building with command '$BUILD_CMD'"
$BUILD_CMD

Expand Down
10 changes: 8 additions & 2 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ description = "Kaspa Python SDK"
[tool.maturin]
name = "kaspa"
bindings = "pyo3"
features = ["pyo3/extension-module"]
features = [
"pyo3/extension-module",
"py-sdk",
]
strip = true
include = ["CHANGELOG.md"]
include = [
"LICENSE",
"CHANGELOG.md"
]