diff options
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -4,11 +4,7 @@ import sys from setuptools import setup - -CFFI_MODULES = [ - "src/build_bcrypt.py:ffi", -] - +from setuptools_rust import RustExtension if platform.python_implementation() == "PyPy": if sys.pypy_version_info < (2, 6): @@ -19,5 +15,18 @@ if platform.python_implementation() == "PyPy": setup( - cffi_modules=CFFI_MODULES, + rust_extensions=[ + RustExtension( + "_bcrypt", + "src/_bcrypt/Cargo.toml", + py_limited_api=True, + # Enable abi3 mode if we're not using PyPy. + features=( + [] + if platform.python_implementation() == "PyPy" + else ["pyo3/abi3-py36"] + ), + rust_version=">=1.56.0", + ), + ], ) |