1{
2 lib,
3 fetchPypi,
4 buildPythonPackage,
5 stdenv,
6 pythonOlder,
7 overrideSDK,
8 rustPlatform,
9 bitstring,
10 cachetools,
11 cffi,
12 deprecation,
13 iconv,
14 matplotlib,
15 numpy,
16 scipy,
17 screed,
18 hypothesis,
19 pytest-xdist,
20 pyyaml,
21 pytestCheckHook,
22}:
23let
24 stdenv' =
25 if stdenv.hostPlatform.isDarwin then overrideSDK stdenv { darwinMinVersion = "10.14"; } else stdenv;
26in
27buildPythonPackage rec {
28 pname = "sourmash";
29 version = "4.8.11";
30 pyproject = true;
31 disabled = pythonOlder "3.9";
32
33 stdenv = stdenv';
34
35 src = fetchPypi {
36 inherit pname version;
37 hash = "sha256-GganbfRkuSaFd5qqpu0CpXe91zpKsyly6BNFgQNNNL8=";
38 };
39
40 cargoDeps = rustPlatform.fetchCargoTarball {
41 inherit src;
42 name = "${pname}-${version}";
43 hash = "sha256-im/TPxnT8c2QbWlzCY60wVwJFRIhSnVW7E4kv6bm0p4=";
44 };
45
46 nativeBuildInputs = with rustPlatform; [
47 cargoSetupHook
48 maturinBuildHook
49 bindgenHook
50 ];
51
52 buildInputs = [ iconv ];
53
54 propagatedBuildInputs = [
55 bitstring
56 cachetools
57 cffi
58 deprecation
59 matplotlib
60 numpy
61 scipy
62 screed
63 ];
64
65 pythonImportsCheck = [ "sourmash" ];
66 nativeCheckInputs = [
67 hypothesis
68 pytest-xdist
69 pytestCheckHook
70 pyyaml
71 ];
72
73 # TODO(luizirber): Working on fixing these upstream
74 disabledTests = [
75 "test_compare_no_such_file"
76 "test_do_sourmash_index_multiscaled_rescale_fail"
77 "test_metagenome_kreport_out_fail"
78 ];
79
80 meta = with lib; {
81 description = "Quickly search, compare, and analyze genomic and metagenomic data sets";
82 mainProgram = "sourmash";
83 homepage = "https://sourmash.bio";
84 changelog = "https://github.com/sourmash-bio/sourmash/releases/tag/v${version}";
85 maintainers = with maintainers; [ luizirber ];
86 license = licenses.bsd3;
87 };
88}