From 9a00f0539d5ab9b03b84625791663f11d7bed75c Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Thu, 2 Jan 2014 13:09:34 -0800 Subject: All the necessary things for setup.py to build cffi stuff --- setup.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 1856cadb..0776ba6e 100644 --- a/setup.py +++ b/setup.py @@ -10,6 +10,8 @@ # implied. # See the License for the specific language governing permissions and # limitations under the License. +from distutils.command.build import build + from setuptools import setup, find_packages @@ -30,6 +32,20 @@ setup_requires = [ CFFI_DEPENDENCY, ] + +class cffi_build(build): + def finalize_options(self): + from cryptography.hazmat.bindings.openssl.binding import Binding + from cryptography.hazmat.primitives import constant_time, padding + + self.distribution.ext_modules = [ + Binding().ffi.verifier.get_extension(), + constant_time._ffi.verifier.get_extension(), + padding._ffi.verifier.get_extension() + ] + build.finalize_options(self) + + setup( name=about["__title__"], version=about["__version__"], @@ -70,4 +86,8 @@ setup( # for cffi zip_safe=False, + ext_package="cryptography", + cmdclass={ + "build": cffi_build, + } ) -- cgit v1.2.3