about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/ndindex/default.nix
blob: 5e98ea18570021cf6743a2e0b879e5d25d824533 (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
{ lib
, buildPythonPackage
, fetchFromGitHub

# build-system
, cython_3

# optional
, numpy

# tests
, hypothesis
, pytest-cov
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "ndindex";
  version = "1.8";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "Quansight-Labs";
    repo = "ndindex";
    rev = "refs/tags/${version}";
    hash = "sha256-F52ly3NkrZ0H9XoomMqmWfLl+8X0z26Yx67DB8DUqyU=";
  };

  nativeBuildInputs = [
    cython_3
  ];

  postPatch = ''
    substituteInPlace pytest.ini \
      --replace "--cov=ndindex/ --cov-report=term-missing --flakes" ""
  '';

  passthru.optional-dependencies.arrays = [
    numpy
  ];

  pythonImportsCheck = [
    "ndindex"
  ];

  nativeCheckInputs = [
    hypothesis
    pytest-cov # uses cov markers
    pytestCheckHook
  ] ++ passthru.optional-dependencies.arrays;

  pytestFlagsArray = [
    # pytest.PytestRemovedIn8Warning: Passing None has been deprecated.
    "--deselect=ndindex/tests/test_ndindex.py::test_ndindex_invalid"
  ];

  meta = with lib; {
    description = "";
    homepage = "https://github.com/Quansight-Labs/ndindex";
    changelog = "https://github.com/Quansight-Labs/ndindex/releases/tag/${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ ];
  };
}