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