|
131 | 131 | # fails and then run the compile.py script again and this time |
132 | 132 | # make should succeed. |
133 | 133 |
|
| 134 | +def run_setuptools_build(): |
| 135 | + ret = subprocess.call("{python} setup.py build_ext --inplace {fast}" |
| 136 | + .format(python=sys.executable, |
| 137 | + fast=('--fast' if FAST_FLAG else '')), shell=True) |
| 138 | + |
| 139 | + |
| 140 | + if ret != 0: |
| 141 | + what = input("%s build failed, press 'y' to continue, 'n' to stop: " % os.path.basename('.')) |
| 142 | + if what != "y": |
| 143 | + sys.exit(1) |
| 144 | + |
| 145 | + return ret |
| 146 | + |
134 | 147 | # -------- CPP_UTILS_DIR |
135 | 148 |
|
136 | 149 | os.chdir(CPP_UTILS_DIR) |
137 | 150 | if not FAST_FLAG: |
138 | 151 | subprocess.call("rm -f *.o *.a", shell=True) |
139 | 152 |
|
140 | | -ret = subprocess.call("make -f Makefile", shell=True) |
141 | | -if ret != 0: |
142 | | - # noinspection PyUnboundLocalVariable |
143 | | - what = input("make failed, press 'y' to continue, 'n' to stop: ") |
144 | | - if what != "y": |
145 | | - sys.exit(1) |
| 153 | +run_setuptools_build() |
| 154 | + |
146 | 155 |
|
147 | 156 | # -------- CLIENT_HANDLER_DIR |
148 | 157 |
|
|
163 | 172 | subprocess.call("rm -f *.o *.a", shell=True) |
164 | 173 | subprocess.call("rm -f subprocess", shell=True) |
165 | 174 |
|
166 | | -ret = subprocess.call("{python} setup.py build_ext --inplace {fast}" |
167 | | - .format(python=sys.executable, |
168 | | - fast=('--fast' if FAST_FLAG else '')), shell=True) |
169 | | -if ret != 0: |
170 | | - what = input("subprocess build failed, press 'y' to continue, 'n' to stop: ") |
171 | | - if what != "y": |
172 | | - sys.exit(1) |
| 175 | +run_setuptools_build() |
173 | 176 |
|
174 | 177 | subprocess_exe = os.path.join(CEFPYTHON_BINARY, "subprocess") |
175 | 178 | if os.path.exists("./subprocess"): |
|
214 | 217 | with open("__version__.pyx", "w") as fo: |
215 | 218 | fo.write('__version__ = "{}"\n'.format(VERSION)) |
216 | 219 |
|
217 | | -# if DEBUG_FLAG: |
218 | | -# ret = subprocess.call("python-dbg setup.py build_ext --inplace" |
219 | | -# " --cython-gdb", shell=True) |
220 | | -if FAST_FLAG: |
221 | | - ret = subprocess.call("{python} setup.py build_ext --inplace --fast" |
222 | | - .format(python=sys.executable), shell=True) |
223 | | -else: |
224 | | - ret = subprocess.call("{python} setup.py build_ext --inplace" |
225 | | - .format(python=sys.executable), shell=True) |
| 220 | +ret = run_setuptools_build() |
226 | 221 |
|
227 | 222 | # if DEBUG_FLAG: |
228 | 223 | # shutil.rmtree("./../binaries_%s/cython_debug/" % BITS, |
|
0 commit comments