about summary refs log tree commit diff
path: root/pkgs/development/python-modules/intake/default.nix
blob: ba078d1f90c37d5d16b92543bac6741130b19721 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
{
  lib,
  stdenv,
  appdirs,
  bokeh,
  buildPythonPackage,
  dask,
  entrypoints,
  fetchFromGitHub,
  fsspec,
  hvplot,
  intake-parquet,
  jinja2,
  msgpack,
  msgpack-numpy,
  pandas,
  panel,
  pyarrow,
  pytestCheckHook,
  python-snappy,
  pythonOlder,
  pyyaml,
  requests,
  setuptools,
  setuptools-scm,
  tornado,
}:

buildPythonPackage rec {
  pname = "intake";
  version = "2.0.3";
  pyproject = true;

  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "intake";
    repo = "intake";
    rev = "refs/tags/${version}";
    hash = "sha256-Fyv85HkoE9OPOoSHR1sgCG0iAFuSiQMT7cyZcQyLvv0=";
  };

  nativeBuildInputs = [
    setuptools
    setuptools-scm
  ];

  propagatedBuildInputs = [
    appdirs
    dask
    entrypoints
    fsspec
    msgpack
    jinja2
    pandas
    pyyaml
  ];

  nativeCheckInputs = [
    intake-parquet
    pytestCheckHook
  ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);

  passthru.optional-dependencies = {
    server = [
      msgpack
      python-snappy
      tornado
    ];
    dataframe = [
      msgpack-numpy
      pyarrow
    ];
    plot = [
      hvplot
      bokeh
      panel
    ];
    remote = [ requests ];
  };

  __darwinAllowLocalNetworking = true;

  preCheck = ''
    export HOME=$(mktemp -d);
    export PATH="$PATH:$out/bin";
  '';

  disabledTestPaths = [
    # Missing plusins
    "intake/catalog/tests/test_alias.py"
    "intake/catalog/tests/test_gui.py"
    "intake/catalog/tests/test_local.py"
    "intake/catalog/tests/test_reload_integration.py"
    "intake/source/tests/test_csv.py"
    "intake/source/tests/test_derived.py"
    "intake/source/tests/test_npy.py"
    "intake/source/tests/test_text.py"
    "intake/tests/test_config.py"
    "intake/tests/test_top_level.py"
  ];

  disabledTests =
    [
      # Disable tests which touch network
      "http"
      "test_address_flag"
      "test_dir"
      "test_discover"
      "test_filtered_compressed_cache"
      "test_flatten_flag"
      "test_get_dir"
      "test_pagination"
      "test_port_flag"
      "test_read_part_compressed"
      "test_read_partition"
      "test_read_pattern"
      "test_remote_arr"
      "test_remote_cat"
      "test_remote_env"
      # ValueError
      "test_datasource_python_to_dask"
      "test_catalog_passthrough"
      # Timing-based, flaky on darwin and possibly others
      "test_idle_timer"
    ]
    ++ lib.optionals
      (stdenv.hostPlatform.isDarwin && lib.versionOlder stdenv.hostPlatform.darwinMinVersion "10.13")
      [
        # Flaky with older low-res mtime on darwin < 10.13 (#143987)
        "test_second_load_timestamp"
      ];

  pythonImportsCheck = [ "intake" ];

  meta = with lib; {
    description = "Data load and catalog system";
    homepage = "https://github.com/ContinuumIO/intake";
    changelog = "https://github.com/intake/intake/blob/${version}/docs/source/changelog.rst";
    license = licenses.bsd2;
    maintainers = [ ];
  };
}