Prerequisites:
In order to build a debug wheel, we first need to build a debug wheel for its dependency cffi.
-
Install pip dependencies:
pip install -U wheel setuptools six asn1crypto ipaddress enum34 -
Download and extract
cffisource (v1.12.3):https://foss.heptapod.net/pypy/cffi/-/archive/v1.12.3/cffi-v1.12.3.zip -
Change to the root of the
cffirepo. -
Build a debug wheel:
python_d setup.py build --debug python_d setup.py bdist_wheel -
Install the debug wheel:
python_d -m pip install --force-reinstall dist\cffi-1.12.3-cp37-cp37dm-win_amd64.whl
Now we can build the debug wheel for cryptography.
-
Set environment variables for OpenSSL (assuming default installation directory). Reference:
set LIB=C:\OpenSSL-Win64\lib;%LIB% set INCLUDE=C:\OpenSSL-Win64\include;%INCLUDE% # This last line is needed if using OpenSSL version < 1.1.0 set CRYPTOGRAPHY_WINDOWS_LINK_LEGACY_OPENSSL=True -
Get
cryptographysource:git clone https://github.com/pyca/cryptography.git cd cryptography git checkout 2.7 -
Build wheel:
python_d setup.py build --debug # Skip rebuilding, otherwise it will rebuild in release (not debug) python_d setup.py bdist_wheel --skip-build
The wheel can be found at dist\cryptography-2.7-cp37-cp37dm-win_amd64.whl.