1{ buildPythonPackage
2, cython
3, fetchFromGitHub
4, isPy38
5, lib
6, lz4
7, numpy
8, pandas
9, pytestCheckHook
10, python-dateutil
11, python-snappy
12, pythonOlder
13, zstandard
14}:
15
16buildPythonPackage rec {
17 pname = "fastavro";
18 version = "1.7.0";
19
20 disabled = pythonOlder "3.6";
21 src = fetchFromGitHub {
22 owner = pname;
23 repo = pname;
24 rev = "refs/tags/${version}";
25 sha256 = "sha256-vzaaX3wj1UkFGCohxYlPw6NA0b+oV/2JtpYXC4zncjk=";
26 };
27
28 preBuild = ''
29 export FASTAVRO_USE_CYTHON=1
30 '';
31
32 nativeBuildInputs = [ cython ];
33
34 checkInputs = [
35 lz4
36 numpy
37 pandas
38 pytestCheckHook
39 python-dateutil
40 python-snappy
41 zstandard
42 ];
43
44 # Fails with "AttributeError: module 'fastavro._read_py' has no attribute
45 # 'CYTHON_MODULE'." Doesn't appear to be serious. See https://github.com/fastavro/fastavro/issues/112#issuecomment-387638676.
46 disabledTests = [ "test_cython_python" ];
47
48 # CLI tests are broken on Python 3.8. See https://github.com/fastavro/fastavro/issues/558.
49 disabledTestPaths = lib.optionals isPy38 [ "tests/test_main_cli.py" ];
50
51 pythonImportsCheck = [ "fastavro" ];
52
53 meta = with lib; {
54 description = "Fast read/write of AVRO files";
55 homepage = "https://github.com/fastavro/fastavro";
56 license = licenses.mit;
57 maintainers = with maintainers; [ samuela ];
58 };
59}