Skip to content

Commit

Permalink
Prefer brotlicffi for PyPy, fixing things for latest brotli release
Browse files Browse the repository at this point in the history
  • Loading branch information
alexprengere committed Sep 11, 2023
1 parent 0abb794 commit 685d341
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion flask_compress/flask_compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

from collections import defaultdict

import brotli
try:
import brotlicffi as brotli
except ImportError:
import brotli

from flask import request, after_this_request, current_app


Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
platforms='any',
install_requires=[
'flask',
'brotli'
"brotli; platform_python_implementation!='PyPy'",
"brotlicffi; platform_python_implementation=='PyPy'"
],
setup_requires=[
'setuptools_scm',
Expand All @@ -37,6 +38,8 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
'Topic :: Software Development :: Libraries :: Python Modules'
]
Expand Down

0 comments on commit 685d341

Please sign in to comment.