diff options
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 27 |
1 files changed, 21 insertions, 6 deletions
@@ -11,6 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import os +from distutils.command.build import build from setuptools import setup, find_packages @@ -25,14 +26,24 @@ with open(os.path.join(base_dir, "cryptography", "__about__.py")) as f: CFFI_DEPENDENCY = "cffi>=0.6" SIX_DEPENDENCY = "six>=1.4.1" -install_requires = [ +requirements = [ CFFI_DEPENDENCY, SIX_DEPENDENCY ] -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) + with open(os.path.join(base_dir, "README.rst")) as f: long_description = f.read() @@ -74,9 +85,13 @@ setup( packages=find_packages(exclude=["tests", "tests.*"]), - install_requires=install_requires, - setup_requires=setup_requires, + install_requires=requirements, + setup_requires=requirements, # for cffi zip_safe=False, + ext_package="cryptography", + cmdclass={ + "build": cffi_build, + } ) |