diff --git a/python/setup.py b/python/setup.py index b0cbd5b1e..bca6b5bb3 100644 --- a/python/setup.py +++ b/python/setup.py @@ -51,9 +51,6 @@ def build_extension(self, ext): # For @pybind11_bazel's `python_configure()`. os.environ['PYTHON_BIN_PATH'] = sys.executable - cmd = ['bazel', 'clean', '--expunge'] - self.spawn(cmd) - cmd = ['bazel', 'build'] if 'BAZEL_CPU' in os.environ: cmd.append(f'--cpu={os.environ["BAZEL_CPU"].lower()}') @@ -65,6 +62,9 @@ def build_extension(self, ext): shutil.copyfile('../bazel-bin/python/_re2.so', self.get_ext_fullpath(ext.name)) + cmd = ['bazel', 'clean', '--expunge'] + self.spawn(cmd) + def include_dirs(): try: