Skip to content

Commit

Permalink
use super() to run default builds
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Sep 1, 2023
1 parent de095d4 commit a1d44f4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions setuptools_rust/setuptools_ext.py
Expand Up @@ -157,6 +157,7 @@ def initialize_options(self) -> None:
self.target = os.getenv("CARGO_BUILD_TARGET")

def run(self) -> None:
super().run()
if self.distribution.rust_extensions:
logger.info("running build_rust")
build_rust = self.get_finalized_command("build_rust")
Expand All @@ -166,8 +167,6 @@ def run(self) -> None:
build_rust.plat_name = self._get_wheel_plat_name() or self.plat_name
build_rust.run()

build_ext_base_class.run(self)

def _get_wheel_plat_name(self) -> Optional[str]:
cmd = _get_bdist_wheel_cmd(self.distribution)
return cast(Optional[str], getattr(cmd, "plat_name", None))
Expand All @@ -191,7 +190,7 @@ def run(self) -> None:
# this is required to make install_scripts compatible with RustBin
class install_rust_extension(install_base_class): # type: ignore[misc,valid-type]
def run(self) -> None:
install_base_class.run(self)
super().run()
install_rustbin = False
if self.distribution.rust_extensions:
install_rustbin = any(
Expand All @@ -210,7 +209,7 @@ def run(self) -> None:
# prevent RustBin from being installed to data_dir
class install_lib_rust_extension(install_lib_base_class): # type: ignore[misc,valid-type]
def get_exclusions(self) -> Set[str]:
exclusions: Set[str] = install_lib_base_class.get_exclusions(self)
exclusions: Set[str] = super().get_exclusions()
install_scripts_obj = cast(
install_scripts, self.get_finalized_command("install_scripts")
)
Expand All @@ -234,7 +233,7 @@ def get_exclusions(self) -> Set[str]:
# this is required to make install_scripts compatible with RustBin
class install_scripts_rust_extension(install_scripts_base_class): # type: ignore[misc,valid-type]
def run(self) -> None:
install_scripts_base_class.run(self)
super().run()
install_scripts_obj = cast(
install_scripts, self.get_finalized_command("install_scripts")
)
Expand Down

0 comments on commit a1d44f4

Please sign in to comment.