about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/sortedcontainers
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-12-06 19:57:55 +0000
committerAlyssa Ross <hi@alyssa.is>2023-02-08 13:48:30 +0000
commitbf3aadfdd39aa197e18bade671fab6726349ffa4 (patch)
tree698567af766ed441d757b57a7b21e68d4a342a2b /nixpkgs/pkgs/development/python-modules/sortedcontainers
parentf4afc5a01d9539ce09e47494e679c51f80723d07 (diff)
parent99665eb45f58d959d2cb9e49ddb960c79d596f33 (diff)
downloadnixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.gz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.bz2
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.lz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.xz
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.tar.zst
nixlib-bf3aadfdd39aa197e18bade671fab6726349ffa4.zip
Merge commit '99665eb45f58d959d2cb9e49ddb960c79d596f33'
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/sortedcontainers')
-rw-r--r--nixpkgs/pkgs/development/python-modules/sortedcontainers/default.nix47
1 files changed, 31 insertions, 16 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/sortedcontainers/default.nix b/nixpkgs/pkgs/development/python-modules/sortedcontainers/default.nix
index 8920336f8db8..4edd68f1f07d 100644
--- a/nixpkgs/pkgs/development/python-modules/sortedcontainers/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/sortedcontainers/default.nix
@@ -1,24 +1,39 @@
 { lib
 , buildPythonPackage
-, fetchPypi
+, fetchFromGitHub
+, pytestCheckHook
 }:
 
-buildPythonPackage rec {
-  pname = "sortedcontainers";
-  version = "2.4.0";
+let
+  sortedcontainers = buildPythonPackage rec {
+    pname = "sortedcontainers";
+    version = "2.4.0";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88";
-  };
+    src = fetchFromGitHub {
+      owner = "grantjenks";
+      repo = "python-sortedcontainers";
+      rev = "v${version}";
+      sha256 = "sha256-YRbSM2isWi7AzfquFvuZBlpEMNUnBJTBLBn0/XYVHKQ=";
+    };
+
+    doCheck = false;
+
+    checkInputs = [
+      pytestCheckHook
+    ];
+
+    pythonImportsCheck = [ "sortedcontainers" ];
 
-  # pypi tarball does not come with tests
-  doCheck = false;
+    passthru.tests = {
+      pytest = sortedcontainers.overridePythonAttrs (_: { doCheck = true; });
+    };
 
-  meta = {
-    description = "Python Sorted Container Types: SortedList, SortedDict, and SortedSet";
-    homepage = "http://www.grantjenks.com/docs/sortedcontainers/";
-    license = lib.licenses.asl20;
-    maintainers = with lib.maintainers; [ costrouc ];
+    meta = with lib; {
+      description = "Python Sorted Container Types: SortedList, SortedDict, and SortedSet";
+      homepage = "https://grantjenks.com/docs/sortedcontainers/";
+      license = licenses.asl20;
+      maintainers = with maintainers; [ SuperSandro2000 ];
+    };
   };
-}
+in
+sortedcontainers