Skip to content
Open
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
13 changes: 13 additions & 0 deletions bindings/python/hatch_build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
import os

from hatchling.builders.hooks.plugin.interface import BuildHookInterface
from hatchling.metadata.plugin.interface import MetadataHookInterface


class CustomMetadataHook(MetadataHookInterface):
def update(self, metadata):
readme_path = os.path.join(self.root, "README.md")
if not os.path.isfile(readme_path):
readme_path = os.path.normpath(os.path.join(self.root, "..", "..", "README.md"))

with open(readme_path, encoding="utf-8") as readme_file:
metadata["readme"] = {"content-type": "text/markdown", "text": readme_file.read()}


class CustomBuildHook(BuildHookInterface):
Expand Down
7 changes: 6 additions & 1 deletion bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ authors = [
{ name="Elias Rohrer", email="dev@tnull.de" },
]
description = "A ready-to-go Lightning node library built using LDK and BDK."
readme = "../../README.md"
dynamic = ["readme"]
requires-python = ">=3.8"
classifiers = [
"Topic :: Software Development :: Libraries",
Expand All @@ -30,4 +30,9 @@ dev = ["requests"]
[tool.hatch.build.targets.wheel]
packages = ["src/ldk_node"]

[tool.hatch.build.targets.sdist.force-include]
"../../README.md" = "README.md"

[tool.hatch.metadata.hooks.custom]

[tool.hatch.build.hooks.custom]
Loading