1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, python
5, numba
6, numpy
7, pandas
8, cramjam
9, fsspec
10, thrift
11, python-lzo
12, pytestCheckHook
13, pythonOlder
14}:
15
16buildPythonPackage rec {
17 pname = "fastparquet";
18 version = "0.8.1";
19 format = "setuptools";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "dask";
25 repo = pname;
26 rev = version;
27 hash = "sha256-rWrbHHcJMahaUV8+YuKkZUhdboNFUK9btjvdg74lCxc=";
28 };
29
30 propagatedBuildInputs = [
31 cramjam
32 fsspec
33 numba
34 numpy
35 pandas
36 thrift
37 ];
38
39 passthru.optional-dependencies = {
40 lzo = [
41 python-lzo
42 ];
43 };
44
45 checkInputs = [
46 pytestCheckHook
47 ];
48
49 postPatch = ''
50 substituteInPlace setup.py \
51 --replace "'pytest-runner'," "" \
52 --replace "oldest-supported-numpy" "numpy"
53 '';
54
55
56 # Workaround https://github.com/NixOS/nixpkgs/issues/123561
57 preCheck = ''
58 mv fastparquet/test .
59 rm -r fastparquet
60 fastparquet_test="$out"/${python.sitePackages}/fastparquet/test
61 ln -s `pwd`/test "$fastparquet_test"
62 '';
63
64 postCheck = ''
65 rm "$fastparquet_test"
66 '';
67
68 pythonImportsCheck = [
69 "fastparquet"
70 ];
71
72 meta = with lib; {
73 description = "A python implementation of the parquet format";
74 homepage = "https://github.com/dask/fastparquet";
75 license = with licenses; [ asl20 ];
76 maintainers = with maintainers; [ veprbl ];
77 };
78}