summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/bbox/default.nix
blob: e46d0caf07380bca6a7a804fefd048c2db2a242c (about) (plain)
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,
  pytestCheckHook,
  pythonOlder,
  matplotlib,
  numpy,
  pendulum,
  pillow,
  poetry-core,
  pyquaternion,
}:

buildPythonPackage rec {
  pname = "bbox";
  version = "0.9.4";
  pyproject = true;

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "varunagrawal";
    repo = pname;
    # matches 0.9.4 on PyPi + tests
    rev = "d3f07ed0e38b6015cf4181e3b3edae6a263f8565";
    hash = "sha256-FrJ8FhlqwmnEB/QvPlkDfqZncNGPhwY9aagM9yv1LGs=";
  };

  nativeBuildInputs = [ poetry-core ];

  postPatch = ''
    substituteInPlace bbox/metrics.py \
      --replace-warn round_ round
  '';

  propagatedBuildInputs = [
    pyquaternion
    numpy
  ];

  nativeCheckInputs = [
    matplotlib
    pendulum
    pillow
    pytestCheckHook
  ];

  disabledTests = [
    # performance test, racy on busy machines
    "test_multi_jaccard_index_2d_performance"
  ];

  pythonRelaxDeps = [ "numpy" ];

  pythonImportsCheck = [ "bbox" ];

  meta = {
    description = "Python library for 2D/3D bounding boxes";
    homepage = "https://github.com/varunagrawal/bbox";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ lucasew ];
  };
}