From e17a9b76d749068078a5e5b6e16f1b8bd0b0912b Mon Sep 17 00:00:00 2001 From: Luiz Irber Date: Fri, 18 Aug 2023 18:33:55 -0700 Subject: [PATCH] python3Packages.sourmash: init at 4.8.3 --- .../python-modules/sourmash/default.nix | 78 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 80 insertions(+) create mode 100644 pkgs/development/python-modules/sourmash/default.nix diff --git a/pkgs/development/python-modules/sourmash/default.nix b/pkgs/development/python-modules/sourmash/default.nix new file mode 100644 index 000000000000..62e048639273 --- /dev/null +++ b/pkgs/development/python-modules/sourmash/default.nix @@ -0,0 +1,78 @@ +{ lib +, fetchPypi +, buildPythonPackage +, pythonOlder +, rustPlatform +, bitstring +, cachetools +, cffi +, deprecation +, iconv +, matplotlib +, numpy +, scipy +, screed +, hypothesis +, pytest-xdist +, pyyaml +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "sourmash"; + version = "4.8.3"; + format = "pyproject"; + disabled = pythonOlder "3.8"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-LIMpL9cLafytRFyPam/FBNi757j1v6o1FG/K2JknDQY="; + }; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-mcJzFRYkdxuqqXH+ryg5v+9tQtuN1hkEeW2DF+wEJ/w="; + }; + + nativeBuildInputs = with rustPlatform; [ + cargoSetupHook + maturinBuildHook + ]; + + buildInputs = [ iconv ]; + + propagatedBuildInputs = [ + bitstring + cachetools + cffi + deprecation + matplotlib + numpy + scipy + screed + ]; + + pythonImportsCheck = [ "sourmash" ]; + nativeCheckInputs = [ + hypothesis + pytest-xdist + pytestCheckHook + pyyaml + ]; + + # TODO(luizirber): Working on fixing these upstream + disabledTests = [ + "test_compare_no_such_file" + "test_do_sourmash_index_multiscaled_rescale_fail" + "test_metagenome_kreport_out_fail" + ]; + + meta = with lib; { + description = "Quickly search, compare, and analyze genomic and metagenomic data sets"; + homepage = "https://sourmash.bio"; + changelog = "https://github.com/sourmash-bio/sourmash/releases/tag/v${version}"; + maintainers = with maintainers; [ luizirber ]; + license = licenses.bsd3; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f70eb2f4e90e..884dbeefbc75 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11879,6 +11879,8 @@ self: super: with self; { soupsieve = callPackage ../development/python-modules/soupsieve { }; + sourmash = callPackage ../development/python-modules/sourmash { }; + soxr = callPackage ../development/python-modules/soxr { libsoxr = pkgs.soxr; };