Tidy up the Python build a little.

Change-Id: I0b152cd0820df0e1e316dbc949e0548043a16600
Reviewed-on: https://code-review.googlesource.com/c/re2/+/61471
Reviewed-by: Alex Chernyakhovsky <achernya@google.com>
Reviewed-by: Paul Wankadia <junyer@google.com>
This commit is contained in:
Paul Wankadia
2023-06-30 13:53:51 +00:00
parent 5a0e23bcbf
commit c53443c80d

View File

@@ -51,9 +51,6 @@ class BuildExt(setuptools.command.build_ext.build_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 @@ class BuildExt(setuptools.command.build_ext.build_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: