1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, geojson
5, google-api-core
6, imagesize
7, nbconvert
8, nbformat
9, numpy
10, opencv4
11, packaging
12, pillow
13, pydantic
14, pyproj
15, pytestCheckHook
16, python-dateutil
17, pythonOlder
18, requests
19, setuptools
20, shapely
21, tqdm
22, typeguard
23, typing-extensions
24}:
25
26buildPythonPackage rec {
27 pname = "labelbox";
28 version = "3.56.0";
29 pyproject = true;
30
31 disabled = pythonOlder "3.7";
32
33 src = fetchFromGitHub {
34 owner = "Labelbox";
35 repo = "labelbox-python";
36 rev = "refs/tags/v.${version}";
37 hash = "sha256-JRh14XpW/iGeBWrslm7weCP/vyJ7eZICqRgQpE2wjXs=";
38 };
39
40 postPatch = ''
41 substituteInPlace pytest.ini \
42 --replace "--reruns 5 --reruns-delay 10" ""
43 '';
44
45 nativeBuildInputs = [
46 setuptools
47 ];
48
49 propagatedBuildInputs = [
50 google-api-core
51 pydantic
52 python-dateutil
53 requests
54 tqdm
55 ];
56
57 passthru.optional-dependencies = {
58 data = [
59 shapely
60 geojson
61 numpy
62 pillow
63 opencv4
64 typeguard
65 imagesize
66 pyproj
67 # pygeotile
68 typing-extensions
69 packaging
70 ];
71 };
72
73 nativeCheckInputs = [
74 nbconvert
75 nbformat
76 pytestCheckHook
77 ] ++ passthru.optional-dependencies.data;
78
79 # disable pytest_plugins which requires `pygeotile`
80 preCheck = ''
81 substituteInPlace tests/conftest.py \
82 --replace "pytest_plugins" "_pytest_plugins"
83 '';
84
85 disabledTestPaths = [
86 # Requires network access
87 "tests/integration"
88 # Missing requirements
89 "tests/data"
90 ];
91
92 pythonImportsCheck = [
93 "labelbox"
94 ];
95
96 meta = with lib; {
97 description = "Platform API for LabelBox";
98 homepage = "https://github.com/Labelbox/labelbox-python";
99 changelog = "https://github.com/Labelbox/labelbox-python/blob/v.${version}/CHANGELOG.md";
100 license = licenses.asl20;
101 maintainers = with maintainers; [ rakesh4g ];
102 };
103}