From 82721c3fb5a5802d5d6ca25073e36ef7d801d7c1 Mon Sep 17 00:00:00 2001 From: fkwp Date: Mon, 23 Jan 2023 22:31:30 +0100 Subject: [PATCH] Update setup.py Override build command in order to prevent a naming clash with the existing 'BUILD' file on non case sensitive filesystems (like on macOS) --- setup.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/setup.py b/setup.py index 0cb5e4f4..4db3ea62 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,20 @@ import os +import distutils.command.build from setuptools import setup +# Override build command in order to prevent a naming clash with the +# existing 'BUILD' file on non case sensitive filesystems (like on macOS) +class BuildCommand(distutils.command.build.build): + def initialize_options(self): + distutils.command.build.build.initialize_options(self) + self.build_base = 'python_build' + os.system("bazel build -c opt //:similarity_result_py_pb2") os.system("bazel build -c opt //:visqol_config_py_pb2") os.system("bazel build -c opt //python:visqol_lib_py.so") setup( + cmdclass={"build": BuildCommand}, name="visqol", version="3.3.3", url="https://github.com/google/visqol",