comparison setup.py @ 30356:9cc438bf7d9a

setup: move cffi stuff to mercurial/cffi This patch moves all setup*cffi stuff to mercurial/cffi to make the root directory cleaner. The idea was from mpm [1]: > It seems like we could have a fair amount of cffi definitions, and > cluttering the root directory (or mercurial/) with them is probably not > a great long-term solution. We could probably add a cffi/ directory > under mercurial/ to parallel pure/. [1]: https://www.mercurial-scm.org/pipermail/mercurial-devel/2016-July/086442.html
author Jun Wu <quark@fb.com>
date Wed, 09 Nov 2016 22:08:30 +0000
parents a8933d992a71
children ce9a3033c118
comparison
equal deleted inserted replaced
30355:fa54f7ade491 30356:9cc438bf7d9a
316 build_py.finalize_options(self) 316 build_py.finalize_options(self)
317 317
318 if self.distribution.pure: 318 if self.distribution.pure:
319 self.distribution.ext_modules = [] 319 self.distribution.ext_modules = []
320 elif self.distribution.cffi: 320 elif self.distribution.cffi:
321 import setup_mpatch_cffi 321 from mercurial.cffi import (
322 import setup_bdiff_cffi 322 bdiff,
323 exts = [setup_mpatch_cffi.ffi.distutils_extension(), 323 mpatch,
324 setup_bdiff_cffi.ffi.distutils_extension()] 324 )
325 exts = [mpatch.ffi.distutils_extension(),
326 bdiff.ffi.distutils_extension()]
325 # cffi modules go here 327 # cffi modules go here
326 if sys.platform == 'darwin': 328 if sys.platform == 'darwin':
327 import setup_osutil_cffi 329 from mercurial.cffi import osutil
328 exts.append(setup_osutil_cffi.ffi.distutils_extension()) 330 exts.append(osutil.ffi.distutils_extension())
329 self.distribution.ext_modules = exts 331 self.distribution.ext_modules = exts
330 else: 332 else:
331 h = os.path.join(get_python_inc(), 'Python.h') 333 h = os.path.join(get_python_inc(), 'Python.h')
332 if not os.path.exists(h): 334 if not os.path.exists(h):
333 raise SystemExit('Python headers are required to build ' 335 raise SystemExit('Python headers are required to build '