about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/labelbox
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/labelbox')
-rw-r--r--nixpkgs/pkgs/development/python-modules/labelbox/default.nix103
1 files changed, 103 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/labelbox/default.nix b/nixpkgs/pkgs/development/python-modules/labelbox/default.nix
new file mode 100644
index 000000000000..2c10a95ca5d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/labelbox/default.nix
@@ -0,0 +1,103 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, geojson
+, google-api-core
+, imagesize
+, nbconvert
+, nbformat
+, numpy
+, opencv4
+, packaging
+, pillow
+, pydantic
+, pyproj
+, pytestCheckHook
+, python-dateutil
+, pythonOlder
+, requests
+, setuptools
+, shapely
+, tqdm
+, typeguard
+, typing-extensions
+}:
+
+buildPythonPackage rec {
+  pname = "labelbox";
+  version = "3.57.0";
+  pyproject = true;
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "Labelbox";
+    repo = "labelbox-python";
+    rev = "refs/tags/v.${version}";
+    hash = "sha256-pAJGgkIWBjBF+9aWGhAz+QZtSiOlip3SIYI4nRQj/oQ=";
+  };
+
+  postPatch = ''
+    substituteInPlace pytest.ini \
+      --replace "--reruns 5 --reruns-delay 10" ""
+  '';
+
+  nativeBuildInputs = [
+    setuptools
+  ];
+
+  propagatedBuildInputs = [
+    google-api-core
+    pydantic
+    python-dateutil
+    requests
+    tqdm
+  ];
+
+  passthru.optional-dependencies = {
+    data = [
+      shapely
+      geojson
+      numpy
+      pillow
+      opencv4
+      typeguard
+      imagesize
+      pyproj
+      # pygeotile
+      typing-extensions
+      packaging
+    ];
+  };
+
+  nativeCheckInputs = [
+    nbconvert
+    nbformat
+    pytestCheckHook
+  ] ++ passthru.optional-dependencies.data;
+
+  # disable pytest_plugins which requires `pygeotile`
+  preCheck = ''
+    substituteInPlace tests/conftest.py \
+      --replace "pytest_plugins" "_pytest_plugins"
+  '';
+
+  disabledTestPaths = [
+    # Requires network access
+    "tests/integration"
+    # Missing requirements
+    "tests/data"
+  ];
+
+  pythonImportsCheck = [
+    "labelbox"
+  ];
+
+  meta = with lib; {
+    description = "Platform API for LabelBox";
+    homepage = "https://github.com/Labelbox/labelbox-python";
+    changelog = "https://github.com/Labelbox/labelbox-python/blob/v.${version}/CHANGELOG.md";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ rakesh4g ];
+  };
+}