@@ -1,18 +1,20 @@
11{ lib
2+, backoff
3+, backports-datetime-fromisoformat
24, buildPythonPackage
3−, fetchPypi
4−, requests
5+, dataclasses
6+, fetchFromGitHub
7+, google-api-core
58, jinja2
9+, ndjson
610, pillow
7−, dataclasses
11+, pydantic
12+, pytest-cases
13+, pytestCheckHook
814, pythonOlder
915, rasterio
16+, requests
1017, shapely
11−, ndjson
12−, backoff
13−, pydantic
14−, google-api-core
15−, backports-datetime-fromisoformat
1618}:
1719
1820buildPythonPackage rec {
@@ -20,27 +22,46 @@ buildPythonPackage rec {
2022 version = "2.5.4";
2123 disabled = pythonOlder "3.6";
2224
23− src = fetchPypi {
24− inherit pname version;
25− sha256 = "sha256-L1KjP8Yzx9adTK84+Nf9JnirT4p3D3lwulWw6W1L/88=";
25+ src = fetchFromGitHub {
26+ owner = "Labelbox";
27+ repo = "labelbox-python";
28+ rev = "v${version}";
29+ sha256 = "0182klvm8bjcm8fkl9w8ypj12s026czgid8ldl6jjvmzhxpmss68";
2630 };
2731
2832 propagatedBuildInputs = [
29− jinja2 requests pillow rasterio shapely ndjson backoff
30− google-api-core backports-datetime-fromisoformat pydantic
33+ backoff
34+ backports-datetime-fromisoformat
35+ dataclasses
36+ google-api-core
37+ jinja2
38+ ndjson
39+ pillow
40+ pydantic
41+ rasterio
42+ requests
43+ shapely
3144 ];
3245
3346 postPatch = ''
3447 substituteInPlace setup.py --replace "pydantic==1.8" "pydantic>=1.8"
3548 '';
3649
37− # Test cases are not running on pypi or GitHub
38− doCheck = false;
50+ checkInputs = [
51+ pytest-cases
52+ pytestCheckHook
53+ ];
54+
55+ disabledTestPaths = [
56+ # Requires network access
57+ "tests/integration"
58+ ];
59+
3960 pythonImportsCheck = [ "labelbox" ];
4061
4162 meta = with lib; {
42− homepage = "https://github.com/Labelbox/Labelbox";
4363 description = "Platform API for LabelBox";
64+ homepage = "https://github.com/Labelbox/labelbox-python";
4465 license = licenses.asl20;
4566 maintainers = with maintainers; [ rakesh4g ];
4667 };