Skip to content

Commit 65077d8

Browse files
authored
chore(build): propagate --inplace (#14741)
## Description `setup.py build_ext --inplace` places built `.so` files under `build/` directory instead of placing them next to the sources as intended. Check `--inplace` is set and use it. ## Testing <!-- Describe your testing strategy or note what tests are included --> ## Risks <!-- Note any risks associated with this change, or "None" if no risks --> ## Additional Notes <!-- Any other information that would be helpful for reviewers -->
1 parent 967ff6d commit 65077d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def run(self):
302302
has_profiling_feature = True
303303
break
304304

305-
if IS_EDITABLE:
305+
if IS_EDITABLE or getattr(self, "inplace", False):
306306
self.inplace = True
307307

308308
super().run()
@@ -528,6 +528,8 @@ def build_rust(self):
528528
build_rust_cmd = CustomBuildRust(self.distribution)
529529
build_rust_cmd.initialize_options()
530530
build_rust_cmd.finalize_options()
531+
# Propagate the inplace flag to the rust build command
532+
build_rust_cmd.inplace = getattr(self, "inplace", False)
531533
build_rust_cmd.run()
532534

533535
self.suffix = sysconfig.get_config_var("EXT_SUFFIX")

0 commit comments

Comments
 (0)