1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 buildPythonPackage,
6 rustPlatform,
7 cargo,
8 rustc,
9 setuptools-rust,
10 unittestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "gb-io";
15 version = "0.2.1";
16 format = "setuptools";
17
18 src = fetchFromGitHub {
19 owner = "althonos";
20 repo = "gb-io.py";
21 rev = "v${version}";
22 hash = "sha256-1B7BUJ8H+pTtmDtazfPfYtlXzL/x4rAHtRIFAAsSoWs=";
23 };
24
25 cargoDeps = rustPlatform.fetchCargoTarball {
26 inherit src sourceRoot;
27 name = "${pname}-${version}";
28 hash = "sha256-lPnOFbEJgcaPPl9bTngugubhW//AUFp9RAjyiFHxC70=";
29 };
30
31 sourceRoot = src.name;
32
33 nativeBuildInputs = [
34 setuptools-rust
35 rustPlatform.cargoSetupHook
36 cargo
37 rustc
38 ];
39
40 nativeCheckInputs = [ unittestCheckHook ];
41
42 pythonImportsCheck = [ "gb_io" ];
43
44 meta = with lib; {
45 broken = stdenv.isDarwin;
46 homepage = "https://github.com/althonos/gb-io.py";
47 description = "A Python interface to gb-io, a fast GenBank parser written in Rust";
48 license = licenses.mit;
49 maintainers = with lib.maintainers; [ dlesl ];
50 };
51}