Switch from brotlipy to brotlicffi for PyPy support
This commit is contained in:
parent
47c85d9afa
commit
d5353a4085
@ -19,7 +19,10 @@ log = logging.getLogger("fontTools.ttLib.woff2")
|
|||||||
|
|
||||||
haveBrotli = False
|
haveBrotli = False
|
||||||
try:
|
try:
|
||||||
import brotli
|
try:
|
||||||
|
import brotlicffi as brotli
|
||||||
|
except ImportError:
|
||||||
|
import brotli
|
||||||
haveBrotli = True
|
haveBrotli = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
@ -21,7 +21,10 @@ import pytest
|
|||||||
|
|
||||||
haveBrotli = False
|
haveBrotli = False
|
||||||
try:
|
try:
|
||||||
import brotli
|
try:
|
||||||
|
import brotlicffi as brotli
|
||||||
|
except ImportError:
|
||||||
|
import brotli
|
||||||
haveBrotli = True
|
haveBrotli = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
pass
|
||||||
|
@ -18,7 +18,10 @@ try:
|
|||||||
except ImportError:
|
except ImportError:
|
||||||
zopfli = None
|
zopfli = None
|
||||||
try:
|
try:
|
||||||
import brotli
|
try:
|
||||||
|
import brotlicffi as brotli
|
||||||
|
except ImportError:
|
||||||
|
import brotli
|
||||||
except ImportError:
|
except ImportError:
|
||||||
brotli = None
|
brotli = None
|
||||||
|
|
||||||
|
4
setup.py
4
setup.py
@ -82,8 +82,8 @@ extras_require = {
|
|||||||
# for fontTools.sfnt and fontTools.woff2: to compress/uncompress
|
# for fontTools.sfnt and fontTools.woff2: to compress/uncompress
|
||||||
# WOFF 1.0 and WOFF 2.0 webfonts.
|
# WOFF 1.0 and WOFF 2.0 webfonts.
|
||||||
"woff": [
|
"woff": [
|
||||||
"brotli >= 1.0.1; platform_python_implementation != 'PyPy'",
|
"brotli >= 1.0.1; platform_python_implementation == 'CPython'",
|
||||||
"brotlipy >= 0.7.0; platform_python_implementation == 'PyPy'",
|
"brotlicffi >= 0.8.0; platform_python_implementation != 'CPython'",
|
||||||
"zopfli >= 0.1.4",
|
"zopfli >= 0.1.4",
|
||||||
],
|
],
|
||||||
# for fontTools.unicode and fontTools.unicodedata: to use the latest version
|
# for fontTools.unicode and fontTools.unicodedata: to use the latest version
|
||||||
|
Loading…
x
Reference in New Issue
Block a user