Skip to content

Commit 910c95f

Browse files
committed
fix build
1 parent 8eeafe5 commit 910c95f

3 files changed

Lines changed: 67 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ dev = [
3636
"pytest-cov>=4.0",
3737
"ruff>=0.1.0",
3838
"mypy>=1.0",
39+
"hatchling>=1.0",
3940
]
4041
docs = [
4142
"mkdocs>=1.5",
@@ -63,9 +64,6 @@ path = "zigx/build.py"
6364
[tool.hatch.build.targets.wheel]
6465
packages = ["zigx"]
6566

66-
[tool.hatch.build.targets.wheel.force-include]
67-
"zigx/zig-out/bin/*" = "zigx/bin/"
68-
6967
[tool.ruff]
7068
target-version = "py38"
7169
line-length = 100

uv.lock

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

zigx/build.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,20 @@ def pre_build(self, wheel_directory: str, config_settings: Optional[Any] = None)
9090
print(f"⚠️ Warning: Binary not found at {binary_path}", file=sys.stderr)
9191
return
9292

93+
# Copy binary to package directory for inclusion
94+
package_bin_dir = zigx_dir / "bin"
95+
package_bin_dir.mkdir(exist_ok=True)
96+
package_binary_path = package_bin_dir / binary_name
97+
98+
import shutil
99+
100+
shutil.copy2(binary_path, package_binary_path)
101+
93102
# Make executable on Unix
94103
if platform.system() != "Windows":
95-
binary_path.chmod(0o755)
104+
package_binary_path.chmod(0o755)
96105

97-
print(f"✅ Successfully compiled zigx binary at {binary_path}", file=sys.stderr)
106+
print(
107+
f"✅ Successfully compiled and copied zigx binary to {package_binary_path}",
108+
file=sys.stderr,
109+
)

0 commit comments

Comments
 (0)