about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/fastavro/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/fastavro/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/fastavro/default.nix59
1 files changed, 59 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/fastavro/default.nix b/nixpkgs/pkgs/development/python-modules/fastavro/default.nix
new file mode 100644
index 000000000000..0bc1246eb326
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/fastavro/default.nix
@@ -0,0 +1,59 @@
+{ buildPythonPackage
+, cython
+, fetchFromGitHub
+, isPy38
+, lib
+, lz4
+, numpy
+, pandas
+, pytestCheckHook
+, python-dateutil
+, python-snappy
+, pythonOlder
+, zstandard
+}:
+
+buildPythonPackage rec {
+  pname = "fastavro";
+  version = "1.4.4";
+
+  disabled = pythonOlder "3.6";
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = version;
+    sha256 = "1sf8nqifwp0cggk59s22ygj3rm1nysa8b91xl8bpv2knqyjy1q32";
+  };
+
+  preBuild = ''
+    export FASTAVRO_USE_CYTHON=1
+  '';
+
+  nativeBuildInputs = [ cython ];
+
+  checkInputs = [
+    lz4
+    numpy
+    pandas
+    pytestCheckHook
+    python-dateutil
+    python-snappy
+    zstandard
+  ];
+
+  # Fails with "AttributeError: module 'fastavro._read_py' has no attribute
+  # 'CYTHON_MODULE'." Doesn't appear to be serious. See https://github.com/fastavro/fastavro/issues/112#issuecomment-387638676.
+  disabledTests = [ "test_cython_python" ];
+
+  # CLI tests are broken on Python 3.8. See https://github.com/fastavro/fastavro/issues/558.
+  disabledTestPaths = lib.optionals isPy38 [ "tests/test_main_cli.py" ];
+
+  pythonImportsCheck = [ "fastavro" ];
+
+  meta = with lib; {
+    description = "Fast read/write of AVRO files";
+    homepage = "https://github.com/fastavro/fastavro";
+    license = licenses.mit;
+    maintainers = with maintainers; [ samuela ];
+  };
+}