Switch from brotlipy to brotlicffi for PyPy support

This commit is contained in:
Seth Michael Larson 2020-12-01 19:36:56 -06:00
parent 47c85d9afa
commit d5353a4085
No known key found for this signature in database
GPG Key ID: 7D5EC9FE0DE2C795
4 changed files with 14 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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