Skip to content

Commit 3bec64f

Browse files
committed
fixes
1 parent e8df0a0 commit 3bec64f

4 files changed

Lines changed: 21 additions & 24 deletions

File tree

hatch_build.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,31 @@
11
from os import environ
2+
from pathlib import Path
23
from sys import platform
34
from platform import machine
45
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
56

7+
68
class CustomHook(BuildHookInterface):
79
def initialize(self, version, build_data):
8-
build_data['pure_python'] = False
10+
build_data["pure_python"] = False
911
arch = environ.get("AUDITWHEEL_ARCH", machine())
1012
if "darwin" in platform:
1113
if "arm" in arch:
12-
build_data['tag'] = "py3-none-macosx_11_0_arm64"
14+
build_data["tag"] = "py3-none-macosx_11_0_arm64"
1315
else:
14-
build_data['tag'] = "py3-none-macosx_11_0_x86_64"
16+
build_data["tag"] = "py3-none-macosx_11_0_x86_64"
1517
elif "linux" in platform:
1618
if "arm" in arch or "aarch" in arch:
17-
build_data['tag'] = "py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64"
19+
build_data["tag"] = "py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64"
1820
else:
19-
build_data['tag'] = 'py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64'
21+
build_data["tag"] = "py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64"
2022
else:
21-
build_data['tag'] = "py3-none-win_amd64"
23+
build_data["tag"] = "py3-none-win_amd64"
24+
25+
# Include native verible binaries as scripts so they land in $PREFIX/bin
26+
bins_dir = Path(self.root) / "verible" / "bin"
27+
if bins_dir.is_dir():
28+
shared = build_data.setdefault("shared_data", {})
29+
for f in bins_dir.iterdir():
30+
if f.is_file():
31+
shared[str(f.relative_to(self.root))] = f"scripts/{f.name}"

pyproject.toml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,6 @@ include = [
128128
"LICENSE",
129129
"README.md",
130130
]
131-
exclude = [
132-
"/.github",
133-
"/scripts",
134-
"/src",
135-
"/.gitmodules",
136-
"/.gitignore",
137-
"/pyproject.toml",
138-
]
139131

140132
[tool.hatch.build.targets.wheel.hooks.custom]
141133

@@ -144,16 +136,11 @@ packages = [
144136
"verible",
145137
]
146138
exclude = [
147-
"/.github",
148-
"/scripts",
149139
"/src",
150-
"/.gitmodules",
151-
"/.gitignore",
152-
"/pyproject.toml",
153140
]
154141

155142
[tool.hatch.build.targets.wheel.shared-data]
156-
"verible/bin" = "verible/bin"
143+
"verible/bin" = "bin"
157144

158145
[tool.pytest.ini_options]
159146
addopts = [

verible/cli.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
from functools import lru_cache
2-
from os import name
32
from pathlib import Path
43
from shutil import which
54
from subprocess import Popen
65
from sys import exit, stderr, stdout
76
from time import sleep
87

9-
108
VERIBLE_TOOLS = [
119
"verible-verilog-syntax",
1210
"verible-verilog-format",
@@ -43,7 +41,7 @@ def main():
4341
from sys import argv as _argv
4442

4543
if len(_argv) < 2:
46-
print(f"Usage: verible-cli <tool> [args...]")
44+
print("Usage: verible-cli <tool> [args...]")
4745
print(f"Available tools: {', '.join(VERIBLE_TOOLS)}")
4846
exit(1)
4947

verible/tests/test_basic.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
def test_import():
22
import verible
3+
34
assert verible.__version__
45

56

67
def test_cli_import():
7-
from verible.cli import main, verible, VERIBLE_TOOLS
8+
from verible.cli import VERIBLE_TOOLS
9+
810
assert len(VERIBLE_TOOLS) > 0

0 commit comments

Comments
 (0)