From 321899bfb3ab34ad78210a4c33102f59717d9da4 Mon Sep 17 00:00:00 2001 From: Luiz Irber Date: Sun, 12 Mar 2023 14:48:34 -0700 Subject: [PATCH] sourmash: init at 4.7.0 --- recipes/recipes_emscripten/sourmash/build.sh | 2 + .../recipes_emscripten/sourmash/recipe.yaml | 42 +++++++++++++++++++ .../sourmash/test_sourmash.py | 17 ++++++++ 3 files changed, 61 insertions(+) create mode 100644 recipes/recipes_emscripten/sourmash/build.sh create mode 100644 recipes/recipes_emscripten/sourmash/recipe.yaml create mode 100644 recipes/recipes_emscripten/sourmash/test_sourmash.py diff --git a/recipes/recipes_emscripten/sourmash/build.sh b/recipes/recipes_emscripten/sourmash/build.sh new file mode 100644 index 000000000..b82cfea56 --- /dev/null +++ b/recipes/recipes_emscripten/sourmash/build.sh @@ -0,0 +1,2 @@ +#!/bin/bash +${PYTHON} -m pip install . diff --git a/recipes/recipes_emscripten/sourmash/recipe.yaml b/recipes/recipes_emscripten/sourmash/recipe.yaml new file mode 100644 index 000000000..9410458d8 --- /dev/null +++ b/recipes/recipes_emscripten/sourmash/recipe.yaml @@ -0,0 +1,42 @@ +package: + name: sourmash + version: '4.7.0' + +source: +- url: https://codeload.github.com/sourmash-bio/sourmash/tar.gz/fecfc97c3ec0be1dcfe43c73a12297f1295b5199 + sha256: 0dff73ca2252877108756cc1e53ef5981312a9006be93dfd88cbd7aaaf35f6ae + +build: + number: 0 + +requirements: + build: + - '{{ compiler("c") }}' + - '{{ compiler("rust") }}' + - cross-python_emscripten-32 + - python + - cffi ==1.15.0 + - pip + - maturin + host: + - python + - pip + - cffi ==1.15.0 + - maturin + - toml + run: + - python + - screed >=1.1.2 + - cffi >=1.14 + - deprecation >=2.0.6 + - cachetools >=4.2.1,<5 + - numpy + - matplotlib-base + - scipy + - bitstring >=3.1.9,<4 + +extra: + emscripten_tests: + python: + pytest_files: + - test_sourmash.py diff --git a/recipes/recipes_emscripten/sourmash/test_sourmash.py b/recipes/recipes_emscripten/sourmash/test_sourmash.py new file mode 100644 index 000000000..51dff699d --- /dev/null +++ b/recipes/recipes_emscripten/sourmash/test_sourmash.py @@ -0,0 +1,17 @@ +def test_simple_save_load(selenium): + from pathlib import Path + from tempfile import TemporaryDirectory + + import sourmash + + mh = sourmash.MinHash(0, 5, scaled=1) + mh.add_sequence("ACGTAGGTATAGGATACCTCGCTAGTACGTGCA") + ss = sourmash.SourmashSignature(mh, name="foo") + + with TemporaryDirectory() as td: + name = Path(td) / "test.sig" + with open(name, "w") as fp: + sourmash.save_signatures([ss], fp=fp) + + loaded = sourmash.load_one_signature(str(name)) + assert loaded == ss