Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / fastavro / default.nix
blobfed754d72945dc4c98f159cabc620cee60f51476
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 , zlib-ng
14 , zstandard
17 buildPythonPackage rec {
18   pname = "fastavro";
19   version = "1.9.4";
20   format = "setuptools";
22   disabled = pythonOlder "3.6";
24   src = fetchFromGitHub {
25     owner = pname;
26     repo = pname;
27     rev = "refs/tags/${version}";
28     hash = "sha256-UWvNEi6vzQknUws+b7UCFUajMUJkfnQkfBeCR0XfqQY=";
29   };
31   preBuild = ''
32     export FASTAVRO_USE_CYTHON=1
33   '';
35   nativeBuildInputs = [ cython ];
37   passthru.optional-dependencies = {
38     codecs = [
39       lz4
40       python-snappy
41       zstandard
42     ];
43     snappy = [
44       python-snappy
45     ];
46     zstandard = [
47       zstandard
48     ];
49     lz4 = [
50       lz4
51     ];
52   };
54   nativeCheckInputs = [
55     numpy
56     pandas
57     pytestCheckHook
58     python-dateutil
59     zlib-ng
60   ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
62   # Fails with "AttributeError: module 'fastavro._read_py' has no attribute
63   # 'CYTHON_MODULE'." Doesn't appear to be serious. See https://github.com/fastavro/fastavro/issues/112#issuecomment-387638676.
64   disabledTests = [ "test_cython_python" ];
66   # CLI tests are broken on Python 3.8. See https://github.com/fastavro/fastavro/issues/558.
67   disabledTestPaths = lib.optionals isPy38 [ "tests/test_main_cli.py" ];
69   pythonImportsCheck = [ "fastavro" ];
71   meta = with lib; {
72     description = "Fast read/write of AVRO files";
73     mainProgram = "fastavro";
74     homepage = "https://github.com/fastavro/fastavro";
75     changelog = "https://github.com/fastavro/fastavro/blob/${version}/ChangeLog";
76     license = licenses.mit;
77     maintainers = with maintainers; [ samuela ];
78   };