Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
79453e7
build: update pyproject.toml to include project metadata as per PEP 621
mg-twentyone Aug 5, 2025
76cfdda
build: update requirements including build package for efficient buil…
mg-twentyone Aug 5, 2025
42750f1
docs: update README.md file to reflect changes in the building process
mg-twentyone Aug 5, 2025
3f8ef43
feat: update justfile to include local build command
mg-twentyone Aug 5, 2025
09efc71
feat: add project urls ref on pyproject.toml file
mg-twentyone Aug 5, 2025
f7b8de0
build: remove setup.py file (new build process has been implemented)
mg-twentyone Aug 5, 2025
455e4f6
docs: remove comment from shell command section
mg-twentyone Aug 5, 2025
d1e6647
fix: remove setuptools-rust dependency
mg-twentyone Aug 8, 2025
549f300
refactor: restore setup.py to properly manage ext modules inclusion
mg-twentyone Aug 8, 2025
b81060e
docs: add arguments to the build process
mg-twentyone Aug 8, 2025
684c018
fix: github action workflow (new build wheel process)
mg-twentyone Aug 8, 2025
4bb5e1a
refactor: add arguments to the build command on justfile
mg-twentyone Aug 8, 2025
4400ecb
refactor: restore plat name parameter on github workflow
mg-twentyone Aug 8, 2025
bbf20ab
chore: resolve merge conflicts with master
mg-twentyone Aug 25, 2025
d9af92c
ci: update github workflow to include new build wheel process
mg-twentyone Aug 26, 2025
9c8db99
chore: update dev version
mg-twentyone Aug 26, 2025
17a58dd
ci: update github workflow paths after repository renaming
mg-twentyone Aug 29, 2025
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
30 changes: 21 additions & 9 deletions .github/workflows/publish-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
fetch-depth: 0

- name: "Configure Git safe directory"
run: git config --global --add safe.directory /__w/bdkpython/bdkpython
run: git config --global --add safe.directory /__w/bdk-python/bdk-python

- name: "Install Rust 1.84.1"
uses: actions-rs/toolchain@v1
Expand All @@ -38,15 +38,18 @@ jobs:
- name: "Generate bdk.py and binaries"
run: bash ./scripts/generate-linux.sh

- name: "Install build"
run: pip install build

- name: "Build wheel"
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
# see issue #350 for more information
run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_28_x86_64 --verbose
run: ${PYBIN}/python -m build --wheel --config-setting=--build-option=--plat-name=manylinux_2_28_x86_64 --verbose

- uses: actions/upload-artifact@v4
with:
name: bdkpython-manylinux_2_28_x86_64-${{ matrix.python }}
path: /home/runner/work/bdkpython/bdkpython/dist/*.whl
path: /home/runner/work/bdk-python/bdk-python/dist/*.whl

build-macos-arm64-wheels:
name: "Build macOS arm64 wheel"
Expand All @@ -73,17 +76,20 @@ jobs:

- name: "Generate bdk.py and binaries"
run: bash ./scripts/generate-macos-arm64.sh

- name: "Install build"
run: pip3 install build

- name: "Build wheel"
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
# see issue #350 for more information
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_arm64 --verbose
run: python3 -m build --wheel --config-setting=--build-option=--plat-name=macosx_11_0_arm64 --verbose

- name: "Upload artifacts"
uses: actions/upload-artifact@v4
with:
name: bdkpython-macos-arm64-${{ matrix.python }}
path: /Users/runner/work/bdkpython/bdkpython/dist/*.whl
path: /Users/runner/work/bdk-python/bdk-python/dist/*.whl

build-macos-x86_64-wheels:
name: "Build macOS x86_64 wheel"
Expand Down Expand Up @@ -111,15 +117,18 @@ jobs:
- name: "Generate bdk.py and binaries"
run: bash ./scripts/generate-macos-x86_64.sh

- name: "Install build"
run: pip3 install build

- name: "Build wheel"
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
# see issue #350 for more information
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_x86_64 --verbose
run: python3 -m build --wheel --config-setting=--build-option=--plat-name=macosx_11_0_x86_64 --verbose

- uses: actions/upload-artifact@v4
with:
name: bdkpython-macos-x86_64-${{ matrix.python }}
path: /Users/runner/work/bdkpython/bdkpython/dist/*.whl
path: /Users/runner/work/bdk-python/bdk-python/dist/*.whl

build-windows-wheels:
name: "Build Windows wheel"
Expand All @@ -146,14 +155,17 @@ jobs:
- name: "Generate bdk.py and binaries"
run: bash ./scripts/generate-windows.sh

- name: "Install build"
run: pip install build

- name: "Build wheel"
run: python setup.py bdist_wheel --verbose
run: python -m build --wheel --verbose

- name: "Upload artifacts"
uses: actions/upload-artifact@v4
with:
name: bdkpython-win-${{ matrix.python }}
path: D:\a\bdkpython\bdkpython\dist\*.whl
path: D:\a\bdk-python\bdk-python\dist\*.whl

publish-pypi:
name: "Publish on PyPI"
Expand Down
38 changes: 23 additions & 15 deletions .github/workflows/test-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
fetch-depth: 0

- name: "Configure Git safe directory"
run: git config --global --add safe.directory /__w/bdkpython/bdkpython
run: git config --global --add safe.directory /__w/bdk-python/bdk-python

- name: "Install Rust 1.84.1"
uses: actions-rs/toolchain@v1
Expand All @@ -41,10 +41,11 @@ jobs:
- name: "Generate bdk.py and binaries"
run: bash ./scripts/generate-linux.sh

- name: "Install build"
run: ${PYBIN}/pip install build

- name: "Build wheel"
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
# see issue #350 for more information
run: ${PYBIN}/python setup.py bdist_wheel --plat-name manylinux_2_28_x86_64 --verbose
run: ${PYBIN}/python -m build --wheel --config-setting=--build-option=--plat-name=manylinux_2_28_x86_64 --verbose

- name: "Install wheel"
run: ${PYBIN}/pip install ./dist/*.whl
Expand All @@ -56,7 +57,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: bdkpython-manylinux_2_28_x86_64-${{ matrix.python }}
path: /home/runner/work/bdkpython/bdkpython/dist/*.whl
path: /home/runner/work/bdk-python/bdk-python/dist/*.whl

build-macos-arm64-wheels:
name: "Build and test macOS arm64 wheels"
Expand Down Expand Up @@ -84,10 +85,13 @@ jobs:
- name: "Generate bdk.py and binaries"
run: bash ./scripts/generate-macos-arm64.sh

- name: "Install build"
run: pip3 install build

- name: "Build wheel"
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
# see issue #350 for more information
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_arm64 --verbose
run: python3 -m build --wheel --config-setting=--build-option=--plat-name=macosx_11_0_arm64 --verbose

# You can't install the arm64 wheel on the CI, so we skip these steps and simply test that the wheel builds
# - name: "Install wheel and run tests"
Expand All @@ -99,7 +103,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: bdkpython-macos-arm64-${{ matrix.python }}
path: /Users/runner/work/bdkpython/bdkpython/dist/*.whl
path: /Users/runner/work/bdk-python/bdk-python/dist/*.whl

build-macos-x86_64-wheels:
name: "Build and test macOS x86_64 wheels"
Expand All @@ -126,10 +130,11 @@ jobs:
- name: "Generate bdk.py and binaries"
run: bash ./scripts/generate-macos-x86_64.sh

- name: "Install build"
run: pip3 install build

- name: "Build wheel"
# Specifying the plat-name argument is necessary to build a wheel with the correct name,
# see issue #350 for more information
run: python3 setup.py bdist_wheel --plat-name macosx_11_0_x86_64 --verbose
run: python3 -m build --wheel --config-setting=--build-option=--plat-name=macosx_11_0_x86_64 --verbose

- name: "Install wheel"
run: pip3 install ./dist/*.whl
Expand All @@ -141,7 +146,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: bdkpython-macos-x86_64-${{ matrix.python }}
path: /Users/runner/work/bdkpython/bdkpython/dist/*.whl
path: /Users/runner/work/bdk-python/bdk-python/dist/*.whl

build-windows-wheels:
name: "Build and test Windows wheels"
Expand Down Expand Up @@ -169,17 +174,20 @@ jobs:
- name: "Generate bdk.py and binaries"
run: bash ./scripts/generate-windows.sh

- name: "Install build"
run: pip install build

- name: "Build wheel"
run: python setup.py bdist_wheel --verbose
run: python -m build --wheel --verbose

- name: "Upload artifact test"
uses: actions/upload-artifact@v4
with:
name: bdkpython-windows-${{ matrix.python }}
path: D:\a\bdkpython\bdkpython\dist\*.whl
path: D:\a\bdk-python\bdk-python\dist\*.whl

- name: "Install dependencies"
run: Get-ChildItem 'D:\a\bdkpython\bdkpython\dist\*.whl' | ForEach-Object {pip install $_.FullName}
run: Get-ChildItem 'D:\a\bdk-python\bdk-python\dist\*.whl' | ForEach-Object {pip install $_.FullName}
shell: powershell

- name: "Run tests"
Expand All @@ -197,7 +205,7 @@ jobs:
fetch-depth: 0

- name: "Configure Git safe directory"
run: git config --global --add safe.directory /__w/bdkpython/bdkpython
run: git config --global --add safe.directory /__w/bdk-python/bdk-python

- name: "Install Ruff"
run: curl -LsSf https://astral.sh/ruff/install.sh | sh
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ This repository uses the bdk-ffi repository as a git submodule. Here are useful

```sh
source .localpythonenv/bin/activate

bash scripts/generate-macos-arm64.sh
python3 setup.py bdist_wheel

python3 -m build --wheel --outdir dist --verbose

pip3 install ./dist/bdkpython-<yourversion>.whl --force-reinstall

python3 -m unittest --verbose
```
10 changes: 10 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ clean:
rm -rf ./build/
rm -rf ./dist/

[group("Build")]
[doc("Build the wheel using pyproject.toml (modern build system).")]
build:
python3 -m build --wheel --verbose

[group("Build")]
[doc("Install the wheel locally (force reinstall).")]
install:
pip3 install dist/bdkpython-*.whl --force-reinstall

[group("Submodule")]
[doc("Initialize bdk-ffi submodule to committed hash.")]
submodule-init:
Expand Down
37 changes: 33 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,36 @@
[build-system]
requires = ["setuptools", "wheel", "setuptools-rust"]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "bdkpython"
version = "2.1.0.dev0"
description = "The Python language bindings for the Bitcoin Development Kit"
readme = "README.md"
requires-python = ">=3.7"
license = "MIT OR Apache-2.0"
license-files = ["LICENSE-MIT", "LICENSE-APACHE"]
authors = [
{ name = "Bitcoin Dev Kit Developers", email = "[email protected]" }
]
keywords = ["bitcoin", "bdk", "wallet", "ffi", "rust"]
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]

[project.urls]
Homepage = "https://github.com/bitcoindevkit"
Repository = "https://github.com/bitcoindevkit/bdk-python"

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
bdkpython = ["libbdkffi.*"]

[tool.pytest.ini_options]
pythonpath = [
"."
]
pythonpath = ["."]
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ semantic-version==2.9.0
typing_extensions==4.0.1
setuptools==75.3.2
wheel==0.38.4
build==1.3.0
30 changes: 1 addition & 29 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,7 @@
#!/usr/bin/env python

from setuptools import setup

LONG_DESCRIPTION = """# bdkpython
The Python language bindings for the [Bitcoin Dev Kit](https://github.com/bitcoindevkit).

## Install the package
```shell
pip install bdkpython
```

## Simple example
```python
from bdkpython import Wallet
```
"""

setup(
name="bdkpython",
version="2.1.0.dev0",
description="The Python language bindings for the Bitcoin Development Kit",
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
include_package_data = True,
zip_safe=False,
packages=["bdkpython"],
package_dir={"bdkpython": "./src/bdkpython"},
url="https://github.com/bitcoindevkit/bdkpython",
author="Bitcoin Dev Kit Developers <[email protected]>",
license="MIT or Apache 2.0",
# This is required to ensure the library name includes the python version, abi, and platform tags
# See issue #350 for more information
has_ext_modules=lambda: True,
)
)
Loading