diff --git a/setup.py b/setup.py index 3c0269b19..ed8c39629 100644 --- a/setup.py +++ b/setup.py @@ -131,7 +131,11 @@ def bazel_build(self, ext: BazelExtension) -> None: # noqa: C901 pkgname = "google_benchmark" pythonroot = Path("bindings") / "python" / "google_benchmark" srcdir = temp_path / "bazel-bin" / pythonroot - libdir = Path(self.build_lib) / pkgname + if not self.inplace: + libdir = Path(self.build_lib) / pkgname + else: + build_py = self.get_finalized_command("build_py") + libdir = build_py.get_package_dir(pkgname) for root, dirs, files in os.walk(srcdir, topdown=True): # exclude runfiles directories and children. dirs[:] = [d for d in dirs if "runfiles" not in d]