PKG Add package `brotli` (#2925)

Co-authored-by: Gyeongjae Choi <def6488@gmail.com>
This commit is contained in:
Mu-Tsun Tsai 2022-08-08 10:25:36 +08:00 committed by GitHub
parent fcfbdccd24
commit 875e2b51de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 1 deletions

View File

@ -216,7 +216,7 @@ substitutions:
ruamel, msprime {pr}`2548`, gmpy2 {pr}`2665`, xgboost {pr}`2537`, galpy {pr}`2676`,
shapely, geos {pr}`2725`, suitesparse, sparseqr {pr}`2685`, libtiff {pr}`2762`,
pytest-benchmark {pr}`2799`, termcolor {pr}`2809`, sqlite3, libproj, pyproj, certifi {pr}`2555`,
rebound {pr}`2868`, pyclipper {pr}`2886`
rebound {pr}`2868`, pyclipper {pr}`2886`, brotli {pr}`2925`
### Miscellaneous

14
packages/brotli/meta.yaml Normal file
View File

@ -0,0 +1,14 @@
package:
name: brotli
version: 1.0.9
source:
url: https://files.pythonhosted.org/packages/2a/18/70c32fe9357f3eea18598b23aa9ed29b1711c3001835f7cf99a9818985d0/Brotli-1.0.9.zip
sha256: 4d1b810aa0ed773f81dceda2cc7b403d01057458730e309856356d4ef4188438
test:
imports:
- brotli
about:
home: https://github.com/google/brotli
PyPI: https://pypi.org/project/brotli
summary: Python bindings for the Brotli compression library
license: MIT

View File

@ -0,0 +1,11 @@
from pytest_pyodide import run_in_pyodide
@run_in_pyodide(packages=["brotli"])
def test_brotli(selenium):
import brotli
x64 = b"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
compress = brotli.compress(x64)
assert compress == b"\x1b?\x00\xf8%\xf0\xe2\x8c\x00\xc0\x00"
assert brotli.decompress(compress) == x64