Skip to content

Commit c256933

Browse files
committed
add cryptography version constraint for PyPy < 5.4
1 parent a40e3b7 commit c256933

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

setup.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
import os
4+
import platform
5+
46
import jose
57

68
from setuptools import setup
@@ -21,9 +23,18 @@ def get_packages(package):
2123
]
2224

2325

26+
def _cryptography_version():
27+
# pyca/cryptography dropped support for PyPy < 5.4 in 2.5
28+
# https://cryptography.io/en/latest/changelog/#v2-5
29+
if platform.python_implementation() == 'PyPy' and platform.python_version() < '5.4':
30+
return 'cryptography < 2.5'
31+
32+
return 'cryptography'
33+
34+
2435
pyasn1 = ['pyasn1']
2536
extras_require = {
26-
'cryptography': ['cryptography'],
37+
'cryptography': [_cryptography_version()],
2738
'pycrypto': ['pycrypto >=2.6.0, <2.7.0'] + pyasn1,
2839
'pycryptodome': ['pycryptodome >=3.3.1, <4.0.0'] + pyasn1,
2940
}

0 commit comments

Comments
 (0)