1{
2 lib,
3 buildPythonPackage,
4 cramjam,
5 cython,
6 fetchFromGitHub,
7 fsspec,
8 git,
9 numpy,
10 packaging,
11 pandas,
12 pytestCheckHook,
13 python-lzo,
14 python,
15 pythonOlder,
16 setuptools-scm,
17 setuptools,
18 wheel,
19}:
20
21buildPythonPackage rec {
22 pname = "fastparquet";
23 version = "2024.11.0";
24 pyproject = true;
25
26 disabled = pythonOlder "3.9";
27
28 src = fetchFromGitHub {
29 owner = "dask";
30 repo = "fastparquet";
31 tag = version;
32 hash = "sha256-GJ6dr36hGjpfEKcA96RpEqY8I1vXooLDGwc0A57yFTY=";
33 };
34
35 build-system = [
36 setuptools
37 setuptools-scm
38 wheel
39 ];
40
41 nativeBuildInputs = [
42 cython
43 git
44 numpy
45 ];
46
47 dependencies = [
48 cramjam
49 fsspec
50 numpy
51 packaging
52 pandas
53 ];
54
55 optional-dependencies = {
56 lzo = [ python-lzo ];
57 };
58
59 nativeCheckInputs = [ pytestCheckHook ];
60
61 # Workaround https://github.com/NixOS/nixpkgs/issues/123561
62 preCheck = ''
63 mv fastparquet/test .
64 rm -r fastparquet
65 fastparquet_test="$out"/${python.sitePackages}/fastparquet/test
66 ln -s `pwd`/test "$fastparquet_test"
67 '';
68
69 postCheck = ''
70 rm "$fastparquet_test"
71 '';
72
73 pythonImportsCheck = [ "fastparquet" ];
74
75 meta = with lib; {
76 description = "Implementation of the parquet format";
77 homepage = "https://github.com/dask/fastparquet";
78 changelog = "https://github.com/dask/fastparquet/blob/${version}/docs/source/releasenotes.rst";
79 license = licenses.asl20;
80 maintainers = with maintainers; [ veprbl ];
81 };
82}