1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 rustPlatform,
6
7 # tests
8 datafusion,
9 pyarrow,
10 pytestCheckHook,
11}:
12
13buildPythonPackage rec {
14 pname = "pyiceberg-core";
15 version = "0.6.0";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "apache";
20 repo = "iceberg-rust";
21 tag = "v${version}";
22 hash = "sha256-vRSZnMkZptGkLZBN1RRu0YGRQCOgJioBIghXnvU9UXc=";
23 };
24
25 sourceRoot = "${src.name}/bindings/python";
26
27 cargoDeps = rustPlatform.fetchCargoVendor {
28 inherit
29 pname
30 version
31 src
32 sourceRoot
33 ;
34 hash = "sha256-QfNVqyZ/O3vZAf689Fg5qPY6jcN4G1zo2eS2AEcdIL4=";
35 };
36
37 nativeBuildInputs = [
38 rustPlatform.cargoSetupHook
39 rustPlatform.maturinBuildHook
40 ];
41
42 pythonImportsCheck = [ "pyiceberg_core" ];
43
44 nativeCheckInputs = [
45 pyarrow
46 pytestCheckHook
47 ];
48
49 disabledTestPaths = [
50 # Circular dependency on pyiceberg
51 "tests/test_datafusion_table_provider.py"
52 ];
53
54 meta = {
55 description = "Iceberg-rust powered core for pyiceberg";
56 homepage = "https://github.com/apache/iceberg-rust/tree/main/bindings/python";
57 changelog = "https://github.com/apache/iceberg-rust/blob/${src.rev}/CHANGELOG.md";
58 license = lib.licenses.asl20;
59 maintainers = with lib.maintainers; [ GaetanLepage ];
60 };
61}