1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 geojson,
6 google-api-core,
7 hatchling,
8 imagesize,
9 mypy,
10 nbconvert,
11 nbformat,
12 numpy,
13 opencv-python-headless,
14 pillow,
15 pydantic,
16 pyproj,
17 pytest-cov-stub,
18 pytest-order,
19 pytest-rerunfailures,
20 pytest-xdist,
21 pytestCheckHook,
22 python-dateutil,
23 pythonOlder,
24 requests,
25 shapely,
26 strenum,
27 tqdm,
28 typeguard,
29 typing-extensions,
30}:
31
32buildPythonPackage rec {
33 pname = "labelbox";
34 version = "6.6.0";
35 pyproject = true;
36
37 disabled = pythonOlder "3.8";
38
39 src = fetchFromGitHub {
40 owner = "Labelbox";
41 repo = "labelbox-python";
42 tag = "v.${version}";
43 hash = "sha256-aMJJZ9ONnjFK/J4pyLTFQox/cC8ij85IYNlJTFrfV2I=";
44 };
45
46 sourceRoot = "${src.name}/libs/labelbox";
47
48 pythonRelaxDeps = [
49 "mypy"
50 "python-dateutil"
51 ];
52
53 build-system = [ hatchling ];
54
55 dependencies = [
56 google-api-core
57 pydantic
58 python-dateutil
59 requests
60 strenum
61 tqdm
62 geojson
63 mypy
64 ];
65
66 optional-dependencies = {
67 data = [
68 shapely
69 numpy
70 pillow
71 opencv-python-headless
72 typeguard
73 imagesize
74 pyproj
75 # pygeotile
76 typing-extensions
77 ];
78 };
79
80 nativeCheckInputs = [
81 nbconvert
82 nbformat
83 pytest-cov-stub
84 pytest-order
85 pytest-rerunfailures
86 pytest-xdist
87 pytestCheckHook
88 ] ++ optional-dependencies.data;
89
90 disabledTestPaths = [
91 # Requires network access
92 "tests/integration"
93 # Missing requirements
94 "tests/data"
95 "tests/unit/test_label_data_type.py"
96 ];
97
98 pythonImportsCheck = [ "labelbox" ];
99
100 meta = with lib; {
101 description = "Platform API for LabelBox";
102 homepage = "https://github.com/Labelbox/labelbox-python";
103 changelog = "https://github.com/Labelbox/labelbox-python/releases/tag/v.${src.tag}";
104 license = licenses.asl20;
105 maintainers = with maintainers; [ rakesh4g ];
106 };
107}