1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 looseversion,
7 mmtf-python,
8 numpy,
9 pandas,
10 pytestCheckHook,
11 fetchpatch2,
12}:
13
14buildPythonPackage rec {
15 pname = "biopandas";
16 version = "0.5.0";
17 pyproject = true;
18
19 src = fetchFromGitHub {
20 owner = "BioPandas";
21 repo = "biopandas";
22 rev = "refs/tags/v${version}";
23 hash = "sha256-1c78baBBsDyvAWrNx5mZI/Q75wyXv0DAwAdWm3EwX/I=";
24 };
25
26 patches = [
27 # Needed for below patch to apply properly
28 (fetchpatch2 {
29 name = "deprecate-mmtf-parsing.patch";
30 url = "https://github.com/BioPandas/biopandas/commit/7a1517dbe76f2c70da8edb35f90c9fa69254e726.patch?full_index=1";
31 hash = "sha256-RFtXFqUYl8GnZ319HsBwx5SUbfUDnR66Ppakdvtg/wI=";
32 })
33 # Remove nose as a dependency.
34 (fetchpatch2 {
35 name = "remove-nose.patch";
36 url = "https://github.com/BioPandas/biopandas/commit/67aa2f237c70c826cd9ab59d6ae114582da2112f.patch?full_index=1";
37 hash = "sha256-fVl57/vGuzlYX/MBZnma1ZFCVmIpjr1k8t3bUJnb/uI=";
38 excludes = [ "setup.py" ];
39 })
40 ];
41
42 pythonRelaxDeps = [ "looseversion" ];
43
44 build-system = [ setuptools ];
45
46 dependencies = [
47 numpy
48 pandas
49 mmtf-python
50 looseversion
51 ];
52
53 nativeCheckInputs = [ pytestCheckHook ];
54
55 disabledTests = [
56 # require network access
57 "test_mmcif_pdb_conversion"
58 "test_fetch_pdb"
59 "test_write_mmtf_bp"
60 "test_write_mmtf"
61 "test_b_factor_shift"
62 ];
63
64 pythonImportsCheck = [ "biopandas" ];
65
66 meta = {
67 description = "Working with molecular structures in pandas DataFrames";
68 homepage = "https://github.com/BioPandas/biopandas";
69 changelog = "https://github.com/BioPandas/biopandas/releases/tag/${src.rev}";
70 license = lib.licenses.bsd3;
71 maintainers = with lib.maintainers; [ natsukium ];
72 };
73}