Setuptools functionality breaks when cffi_modules is used

Issue #345 resolved
Arnout van Meer
created an issue

We've just had to change how one of our cffi related modules builds and added cffi_modules to our This broke our build. I think I tracked the root of the issue down to, specifically _add_py_module importing build_py (and likely build_ext) from distutils instead of setuptools. This results in any setuptools functionality getting 'lost'. It looks like an earlier modification to _add_c_module above it already seems to have fixed this.

We'd appreciated a quick fix to this; currently we're unable to make builds unless we locally edit the module.

Proposed patch:

 def _add_py_module(dist, ffi, module_name):
     from distutils.dir_util import mkpath
-    from distutils.command.build_py import build_py
-    from distutils.command.build_ext import build_ext
+    from setuptools.command.build_py import build_py
+    from setuptools.command.build_ext import build_ext
     from distutils import log
     from cffi import recompiler

Comments (2)

  1. Log in to comment