Skip to content

Commit 4df5622

Browse files
committed
fix: install bundled binaries into platlib
1 parent 8a36136 commit 4df5622

7 files changed

Lines changed: 28 additions & 8 deletions

File tree

cppllvm_build.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel
1717
from setuptools.command.build_py import build_py as _build_py
18+
from setuptools.command.install import install as _install
1819
from setuptools.errors import SetupError
1920

2021
if sys.version_info >= (3, 11):
@@ -249,12 +250,17 @@ def stage_payload(config: PackageBuildConfig, build_lib: Path) -> None:
249250

250251
def make_build_commands(
251252
config: PackageBuildConfig,
252-
) -> tuple[type[_build_py], type[_bdist_wheel]]:
253+
) -> tuple[type[_build_py], type[_bdist_wheel], type[_install]]:
253254
class build_py(_build_py):
254255
def run(self) -> None:
255256
super().run()
256257
stage_payload(config, Path(self.build_lib))
257258

259+
class install(_install):
260+
def finalize_options(self) -> None:
261+
super().finalize_options()
262+
self.install_lib = self.install_platlib
263+
258264
class bdist_wheel(_bdist_wheel):
259265
def finalize_options(self) -> None:
260266
super().finalize_options()
@@ -264,4 +270,4 @@ def get_tag(self) -> tuple[str, str, str]:
264270
_, _, platform_tag = super().get_tag()
265271
return "py3", "none", platform_tag
266272

267-
return build_py, bdist_wheel
273+
return build_py, bdist_wheel, install

packages/cformat/build_hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
sys.modules[MODULE_SPEC.name] = BUILD_HELPERS
1818
MODULE_SPEC.loader.exec_module(BUILD_HELPERS)
1919

20-
build_py, bdist_wheel = BUILD_HELPERS.make_build_commands(
20+
build_py, bdist_wheel, install = BUILD_HELPERS.make_build_commands(
2121
BUILD_HELPERS.PackageBuildConfig(
2222
package_dir=ROOT,
2323
package_name="cformat",

packages/cformat/cppllvm_build.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel
1717
from setuptools.command.build_py import build_py as _build_py
18+
from setuptools.command.install import install as _install
1819
from setuptools.errors import SetupError
1920

2021
if sys.version_info >= (3, 11):
@@ -249,12 +250,17 @@ def stage_payload(config: PackageBuildConfig, build_lib: Path) -> None:
249250

250251
def make_build_commands(
251252
config: PackageBuildConfig,
252-
) -> tuple[type[_build_py], type[_bdist_wheel]]:
253+
) -> tuple[type[_build_py], type[_bdist_wheel], type[_install]]:
253254
class build_py(_build_py):
254255
def run(self) -> None:
255256
super().run()
256257
stage_payload(config, Path(self.build_lib))
257258

259+
class install(_install):
260+
def finalize_options(self) -> None:
261+
super().finalize_options()
262+
self.install_lib = self.install_platlib
263+
258264
class bdist_wheel(_bdist_wheel):
259265
def finalize_options(self) -> None:
260266
super().finalize_options()
@@ -264,4 +270,4 @@ def get_tag(self) -> tuple[str, str, str]:
264270
_, _, platform_tag = super().get_tag()
265271
return "py3", "none", platform_tag
266272

267-
return build_py, bdist_wheel
273+
return build_py, bdist_wheel, install

packages/cformat/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
cmdclass={
2020
"build_py": BUILD_HOOKS.build_py,
2121
"bdist_wheel": BUILD_HOOKS.bdist_wheel,
22+
"install": BUILD_HOOKS.install,
2223
}
2324
)

packages/ctidy/build_hooks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
sys.modules[MODULE_SPEC.name] = BUILD_HELPERS
1616
MODULE_SPEC.loader.exec_module(BUILD_HELPERS)
1717

18-
build_py, bdist_wheel = BUILD_HELPERS.make_build_commands(
18+
build_py, bdist_wheel, install = BUILD_HELPERS.make_build_commands(
1919
BUILD_HELPERS.PackageBuildConfig(
2020
package_dir=ROOT,
2121
package_name="ctidy",

packages/ctidy/cppllvm_build.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from setuptools.command.bdist_wheel import bdist_wheel as _bdist_wheel
1717
from setuptools.command.build_py import build_py as _build_py
18+
from setuptools.command.install import install as _install
1819
from setuptools.errors import SetupError
1920

2021
if sys.version_info >= (3, 11):
@@ -249,12 +250,17 @@ def stage_payload(config: PackageBuildConfig, build_lib: Path) -> None:
249250

250251
def make_build_commands(
251252
config: PackageBuildConfig,
252-
) -> tuple[type[_build_py], type[_bdist_wheel]]:
253+
) -> tuple[type[_build_py], type[_bdist_wheel], type[_install]]:
253254
class build_py(_build_py):
254255
def run(self) -> None:
255256
super().run()
256257
stage_payload(config, Path(self.build_lib))
257258

259+
class install(_install):
260+
def finalize_options(self) -> None:
261+
super().finalize_options()
262+
self.install_lib = self.install_platlib
263+
258264
class bdist_wheel(_bdist_wheel):
259265
def finalize_options(self) -> None:
260266
super().finalize_options()
@@ -264,4 +270,4 @@ def get_tag(self) -> tuple[str, str, str]:
264270
_, _, platform_tag = super().get_tag()
265271
return "py3", "none", platform_tag
266272

267-
return build_py, bdist_wheel
273+
return build_py, bdist_wheel, install

packages/ctidy/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
cmdclass={
2020
"build_py": BUILD_HOOKS.build_py,
2121
"bdist_wheel": BUILD_HOOKS.bdist_wheel,
22+
"install": BUILD_HOOKS.install,
2223
}
2324
)

0 commit comments

Comments
 (0)