about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/neo4j/default.nix
blob: 5215da38339c6ae038c135f7a145fa4635629e50 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{ lib
, buildPythonPackage
, fetchFromGitHub
, numpy
, pandas
, pyarrow
, pythonOlder
, pytz
, setuptools
, tomlkit
}:

buildPythonPackage rec {
  pname = "neo4j";
  version = "5.16.0";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "neo4j";
    repo = "neo4j-python-driver";
    rev = "refs/tags/${version}";
    hash = "sha256-ly/R2ufd5gEkUyfajpeMQblTiKipC9HFtxkWkh16zLo=";
  };

  postPatch = ''
    # The dynamic versioning adds a postfix (.dev0) to the version
    substituteInPlace pyproject.toml \
      --replace '"tomlkit ~= 0.11.6"' '"tomlkit >= 0.11.6"' \
      --replace 'dynamic = ["version", "readme"]' 'dynamic = ["readme"]' \
      --replace '#readme = "README.rst"' 'version = "${version}"'
  '';

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    pytz
    tomlkit
  ];

  passthru.optional-dependencies = {
    numpy = [
      numpy
    ];
    pandas = [
      numpy
      pandas
    ];
    pyarrow = [
      pyarrow
    ];
  };

  # Missing dependencies
  doCheck = false;

  pythonImportsCheck = [
    "neo4j"
  ];

  meta = with lib; {
    description = "Neo4j Bolt Driver for Python";
    homepage = "https://github.com/neo4j/neo4j-python-driver";
    changelog = "https://github.com/neo4j/neo4j-python-driver/releases/tag/${version}";
    license = licenses.asl20;
    maintainers = with maintainers; [ fab ];
  };
}