Skip to content

Commit cca2a16

Browse files
authored
Only patch when called with "bdist_wheel"
"pip wheel" will call setup.py multiple times, so we should only run "patch" once when setup.py is called with "bdist_wheel".
1 parent 3575544 commit cca2a16

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

setup.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ def main():
148148
# https://github.com/skvark/opencv-python/issues/21
149149
cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++")
150150
cmake_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9")
151-
subprocess.check_call("patch -p1 < patches/patchQtPlugins", shell=True)
151+
if "bdist_wheel" in sys.argv:
152+
subprocess.check_call("patch -p1 < patches/patchQtPlugins", shell=True)
152153

153154
if sys.platform.startswith('linux'):
154155
cmake_args.append("-DWITH_IPP=OFF") # tests fail with IPP compiled with
@@ -157,7 +158,8 @@ def main():
157158
if sys.platform.startswith('linux') and not x64:
158159
cmake_args.append("-DCMAKE_CXX_FLAGS=-U__STRICT_ANSI__")
159160
# patch openEXR when building on i386, see: https://github.com/openexr/openexr/issues/128
160-
subprocess.check_call("patch -p0 < patches/patchOpenEXR", shell=True)
161+
if "bdist_wheel" in sys.argv:
162+
subprocess.check_call("patch -p0 < patches/patchOpenEXR", shell=True)
161163

162164

163165
if 'CMAKE_ARGS' in os.environ:

0 commit comments

Comments
 (0)