Skip to content

Commit

Permalink
Add python packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Nov 10, 2023
1 parent d955e62 commit f76664f
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
21 changes: 21 additions & 0 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[project]
name = "ldk_node"
version = "0.1-alpha.1"
authors = [
{ name="Elias Rohrer", email="[email protected]" },
]
description = "A ready-to-go Lightning node library built using LDK and BDK."
readme = "README.md"
requires-python = ">=3.6"
classifiers = [
"Topic :: Software Development :: Libraries",
"Topic :: Security :: Cryptography",
"License :: OSI Approved :: MIT License",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
]

[project.urls]
"Homepage" = "https://lightningdevkit.org/"
"Github" = "https://github.com/lightningdevkit/ldk-node"
"Bug Tracker" = "https://github.com/lightningdevkit/ldk-node/issues"
13 changes: 13 additions & 0 deletions bindings/python/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[options]
packages = find:
package_dir =
= src
include_package_data = True

[options.packages.find]
where = src

[options.package_data]
ldk_node =
*.so
*.dylib
1 change: 1 addition & 0 deletions bindings/python/src/ldk_node/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from ldk_node.ldk_node import *
3 changes: 3 additions & 0 deletions scripts/python_create_package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
cd bindings/python || exit 1
python3 -m build
6 changes: 3 additions & 3 deletions scripts/uniffi_bindgen_generate_python.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
BINDINGS_DIR="./bindings/python"
BINDINGS_DIR="./bindings/python/src/ldk_node"
UNIFFI_BINDGEN_BIN="cargo run --manifest-path bindings/uniffi-bindgen/Cargo.toml"

cargo build --release --features uniffi || exit 1
cargo build --profile release-smaller --features uniffi || exit 1
$UNIFFI_BINDGEN_BIN generate bindings/ldk_node.udl --language python -o "$BINDINGS_DIR" || exit 1
cp ./target/release/libldk_node.dylib "$BINDINGS_DIR"/libldk_node.dylib || exit 1
cp ./target/release-smaller/libldk_node.dylib "$BINDINGS_DIR"/libldk_node.dylib || exit 1

0 comments on commit f76664f

Please sign in to comment.