Skip to content

Commit 3ab25b3

Browse files
authored
Merge pull request #362 from davidhewitt/use-super
use super() to call base commands
2 parents b13f6d7 + dd6c0e2 commit 3ab25b3

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

noxfile.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ def test_crossenv(session: nox.Session):
6666
6767
cd examples/rust_with_cffi/
6868
python3.9 -m pip install crossenv
69-
python3.9 -m crossenv "/opt/python/cp39-cp39/bin/python3" --cc $TARGET_CC --cxx $TARGET_CXX --sysroot $TARGET_SYSROOT --env LIBRARY_PATH= --manylinux manylinux1 venv
70-
. venv/bin/activate
69+
python3.9 -m crossenv "/opt/python/cp39-cp39/bin/python3" --cc $TARGET_CC --cxx $TARGET_CXX --sysroot $TARGET_SYSROOT --env LIBRARY_PATH= --manylinux manylinux1 /venv
70+
. /venv/bin/activate
7171
72-
build-pip install -U pip>=23.2.1 setuptools>=68.0.0 wheel>=0.41.1
73-
cross-pip install -U pip>=23.2.1 setuptools>=68.0.0 wheel>=0.41.1
72+
build-pip install -U 'pip>=23.2.1' 'setuptools>=68.0.0' 'wheel>=0.41.1'
73+
cross-pip install -U 'pip>=23.2.1' 'setuptools>=68.0.0' 'wheel>=0.41.1'
7474
build-pip install cffi
7575
cross-expose cffi
7676
cross-pip install -e ../../

setuptools_rust/setuptools_ext.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ def initialize_options(self) -> None:
157157
self.target = os.getenv("CARGO_BUILD_TARGET")
158158

159159
def run(self) -> None:
160+
super().run()
160161
if self.distribution.rust_extensions:
161162
logger.info("running build_rust")
162163
build_rust = self.get_finalized_command("build_rust")
@@ -166,8 +167,6 @@ def run(self) -> None:
166167
build_rust.plat_name = self._get_wheel_plat_name() or self.plat_name
167168
build_rust.run()
168169

169-
build_ext_base_class.run(self)
170-
171170
def _get_wheel_plat_name(self) -> Optional[str]:
172171
cmd = _get_bdist_wheel_cmd(self.distribution)
173172
return cast(Optional[str], getattr(cmd, "plat_name", None))
@@ -191,7 +190,7 @@ def run(self) -> None:
191190
# this is required to make install_scripts compatible with RustBin
192191
class install_rust_extension(install_base_class): # type: ignore[misc,valid-type]
193192
def run(self) -> None:
194-
install_base_class.run(self)
193+
super().run()
195194
install_rustbin = False
196195
if self.distribution.rust_extensions:
197196
install_rustbin = any(
@@ -210,7 +209,7 @@ def run(self) -> None:
210209
# prevent RustBin from being installed to data_dir
211210
class install_lib_rust_extension(install_lib_base_class): # type: ignore[misc,valid-type]
212211
def get_exclusions(self) -> Set[str]:
213-
exclusions: Set[str] = install_lib_base_class.get_exclusions(self)
212+
exclusions: Set[str] = super().get_exclusions()
214213
build_rust = self.get_finalized_command("build_rust")
215214
scripts_path = os.path.join(
216215
self.install_dir, build_rust.data_dir, "scripts"
@@ -234,7 +233,7 @@ def get_exclusions(self) -> Set[str]:
234233
# this is required to make install_scripts compatible with RustBin
235234
class install_scripts_rust_extension(install_scripts_base_class): # type: ignore[misc,valid-type]
236235
def run(self) -> None:
237-
install_scripts_base_class.run(self)
236+
super().run()
238237
build_ext = self.get_finalized_command("build_ext")
239238
build_rust = self.get_finalized_command("build_rust")
240239
scripts_path = os.path.join(

0 commit comments

Comments
 (0)