summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorFabian Affolter <fabian@affolter-engineering.ch>2021-05-06 18:42:27 +0200
committerGitHub <noreply@github.com>2021-05-06 18:42:27 +0200
commit28907d3bffaaf3e73e3f1c7ff59923c4b66afd38 (patch)
tree588591ef22ef9050bba65869549d75ef1dcd82ec /pkgs
parent59bf1c28dcd4902cc4293661614c510d09a704a1 (diff)
parent112a1f6fd7a27653964bc4b444ae4112edfe2cc1 (diff)
downloadnixpkgs-28907d3bffaaf3e73e3f1c7ff59923c4b66afd38.tar
nixpkgs-28907d3bffaaf3e73e3f1c7ff59923c4b66afd38.tar.gz
nixpkgs-28907d3bffaaf3e73e3f1c7ff59923c4b66afd38.tar.bz2
nixpkgs-28907d3bffaaf3e73e3f1c7ff59923c4b66afd38.tar.lz
nixpkgs-28907d3bffaaf3e73e3f1c7ff59923c4b66afd38.tar.xz
nixpkgs-28907d3bffaaf3e73e3f1c7ff59923c4b66afd38.tar.zst
nixpkgs-28907d3bffaaf3e73e3f1c7ff59923c4b66afd38.zip
Merge pull request #121677 from fabaff/bump-labelbox
python3Packages.labelbox: 2.5.1 -> 2.5.4
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/python-modules/decopatch/default.nix37
-rw-r--r--pkgs/development/python-modules/labelbox/default.nix59
-rw-r--r--pkgs/development/python-modules/pytest-cases/default.nix51
-rw-r--r--pkgs/top-level/python-packages.nix4
4 files changed, 136 insertions, 15 deletions
diff --git a/pkgs/development/python-modules/decopatch/default.nix b/pkgs/development/python-modules/decopatch/default.nix
new file mode 100644
index 00000000000..7fa3c6465db
--- /dev/null
+++ b/pkgs/development/python-modules/decopatch/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, makefun
+, setuptools-scm
+}:
+
+buildPythonPackage rec {
+  pname = "decopatch";
+  version = "1.4.8";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0i6i811s2j1z0cl6y177dwsbfxib8dvb5c2jpgklvc2xy4ahhsy6";
+  };
+
+  nativeBuildInputs = [ setuptools-scm ];
+
+  propagatedBuildInputs = [ makefun ];
+
+  postPatch = ''
+    substituteInPlace setup.py --replace "'pytest-runner', " ""
+  '';
+
+  # Tests would introduce multiple cirucular dependencies
+  # Affected: makefun, pytest-cases
+  doCheck = false;
+
+  pythonImportsCheck = [ "decopatch" ];
+
+  meta = with lib; {
+    description = "Python helper for decorators";
+    homepage = "https://github.com/smarie/python-decopatch";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/labelbox/default.nix b/pkgs/development/python-modules/labelbox/default.nix
index ce7cff4d79b..957b8ad5fd1 100644
--- a/pkgs/development/python-modules/labelbox/default.nix
+++ b/pkgs/development/python-modules/labelbox/default.nix
@@ -1,38 +1,67 @@
 { lib
+, backoff
+, backports-datetime-fromisoformat
 , buildPythonPackage
-, fetchPypi
-, requests
+, dataclasses
+, fetchFromGitHub
+, google-api-core
 , jinja2
+, ndjson
 , pillow
+, pydantic
+, pytest-cases
+, pytestCheckHook
+, pythonOlder
 , rasterio
+, requests
 , shapely
-, ndjson
-, backoff
-, google-api-core
-, backports-datetime-fromisoformat
 }:
 
 buildPythonPackage rec {
   pname = "labelbox";
-  version = "2.5.1";
+  version = "2.5.4";
+  disabled = pythonOlder "3.6";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "7f2cbc5d4869d8acde865ad519fc1cc85338247cd7cf534334f988a040679219";
+  src = fetchFromGitHub {
+    owner = "Labelbox";
+    repo = "labelbox-python";
+    rev = "v${version}";
+    sha256 = "0182klvm8bjcm8fkl9w8ypj12s026czgid8ldl6jjvmzhxpmss68";
   };
 
   propagatedBuildInputs = [
-    jinja2 requests pillow rasterio shapely ndjson backoff
-    google-api-core backports-datetime-fromisoformat
+    backoff
+    backports-datetime-fromisoformat
+    dataclasses
+    google-api-core
+    jinja2
+    ndjson
+    pillow
+    pydantic
+    rasterio
+    requests
+    shapely
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.py --replace "pydantic==1.8" "pydantic>=1.8"
+  '';
+
+  checkInputs = [
+    pytest-cases
+    pytestCheckHook
+  ];
+
+  disabledTestPaths = [
+    # Requires network access
+    "tests/integration"
   ];
 
-  # Test cases are not running on pypi or GitHub
-  doCheck = false;
   pythonImportsCheck = [ "labelbox" ];
 
   meta = with lib; {
-    homepage = "https://github.com/Labelbox/Labelbox";
     description = "Platform API for LabelBox";
+    homepage = "https://github.com/Labelbox/labelbox-python";
     license = licenses.asl20;
     maintainers = with maintainers; [ rakesh4g ];
   };
diff --git a/pkgs/development/python-modules/pytest-cases/default.nix b/pkgs/development/python-modules/pytest-cases/default.nix
new file mode 100644
index 00000000000..2914b3cf9aa
--- /dev/null
+++ b/pkgs/development/python-modules/pytest-cases/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, makefun
+, decopatch
+, pythonOlder
+, pytest
+, setuptools-scm
+}:
+
+buildPythonPackage rec {
+  pname = "pytest-cases";
+  version = "3.4.6";
+  disabled = pythonOlder "3.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "17w4s6622i97q81g15zamqm536ib00grgdfk2f4kk9bw2k7sdlq6";
+  };
+
+  nativeBuildInputs = [
+    setuptools-scm
+  ];
+
+  buildInputs = [
+    pytest
+  ];
+
+  propagatedBuildInputs = [
+    decopatch
+    makefun
+  ];
+
+  postPatch = ''
+    substituteInPlace setup.cfg --replace "pytest-runner" ""
+  '';
+
+  # Tests have dependencies (pytest-harvest, pytest-steps) which
+  # are not available in Nixpkgs. Most of the packages (decopatch,
+  # makefun, pytest-*) have circular dependecies.
+  doCheck = false;
+
+  pythonImportsCheck = [ "pytest_cases" ];
+
+  meta = with lib; {
+    description = "Separate test code from test cases in pytest";
+    homepage = "https://github.com/smarie/python-pytest-cases";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 18445278c1b..33559777930 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1733,6 +1733,8 @@ in {
 
   decorator = callPackage ../development/python-modules/decorator { };
 
+  decopatch = callPackage ../development/python-modules/decopatch { };
+
   deep_merge = callPackage ../development/python-modules/deep_merge { };
 
   deepdiff = callPackage ../development/python-modules/deepdiff { };
@@ -6267,6 +6269,8 @@ in {
   pytest-cache = self.pytestcache; # added 2021-01-04
   pytestcache = callPackage ../development/python-modules/pytestcache { };
 
+  pytest-cases = callPackage ../development/python-modules/pytest-cases{ };
+
   pytest-catchlog = callPackage ../development/python-modules/pytest-catchlog { };
 
   pytest-celery = callPackage ../development/python-modules/pytest-celery { };