Skip to content

Commit

Permalink
Add cramjam (#1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger authored Sep 11, 2024
1 parent f0bd873 commit 62197f7
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
4 changes: 4 additions & 0 deletions recipes/recipes_emscripten/cramjam/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

export MATURIN_PYTHON_SYSCONFIGDATA_DIR=${PREFIX}/etc/conda/_sysconfigdata__emscripten_wasm32-emscripten.py
${PYTHON} -m pip install . -vv
53 changes: 53 additions & 0 deletions recipes/recipes_emscripten/cramjam/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
context:
name: cramjam
version: 2.8.3

package:
name: ${{ name|lower }}
version: ${{ version }}

source:
url: https://pypi.io/packages/source/${{ name[0] }}/${{ name }}/${{ name }}-${{ version }}.tar.gz
sha256: 6b1fa0a6ea8183831d04572597c182bd6cece62d583a36cde1e6a86e72ce2389

build:
number: 0

requirements:
build:
- python
- cross-python_${{ target_platform }}
- maturin
- toml
- rust
- ${{ compiler('cxx') }}
host:
- python
- pip
run:
- python

tests:
- script: pytester
files:
recipe:
- test_cramjam.py
requirements:
build:
- pytester
run:
- pytester-run

about:
homepage: https://github.com/milesgranger/cramjam
license: MIT
license_family: MIT
license_file: LICENSE
summary: python bindings to rust-implemented compression
description: |
Extremely thin Python bindings to de/compression algorithms in Rust.
documentation: https://docs.rs/cramjam

extra:
recipe-maintainers:
- milesgranger
6 changes: 6 additions & 0 deletions recipes/recipes_emscripten/cramjam/test_cramjam.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
def test_cramjam():
import cramjam

compressed = cramjam.snappy.compress(b"bytes")
decompressed = cramjam.snappy.decompress(compressed)
assert bytes(decompressed) == b"bytes"

0 comments on commit 62197f7

Please sign in to comment.