From 1987b350441c59b49127e9cdd2c2596b8a664edb Mon Sep 17 00:00:00 2001
From: mxmlnkn <mxmlnkn@github.de>
Date: Wed, 6 Sep 2023 19:13:20 +0200
Subject: [PATCH] python3Packages.indexed-gzip: init at 1.8.5

---
 .../python-modules/indexed-gzip/default.nix   | 37 +++++++++++++++++++
 pkgs/top-level/python-packages.nix            |  2 +
 2 files changed, 39 insertions(+)
 create mode 100644 pkgs/development/python-modules/indexed-gzip/default.nix

diff --git a/pkgs/development/python-modules/indexed-gzip/default.nix b/pkgs/development/python-modules/indexed-gzip/default.nix
new file mode 100644
index 000000000000..73ad916f35f8
--- /dev/null
+++ b/pkgs/development/python-modules/indexed-gzip/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pythonOlder
+, cython
+, zlib
+}:
+
+buildPythonPackage rec {
+  pname = "indexed_gzip";
+  version = "1.8.5";
+  format = "setuptools";
+
+  disabled = pythonOlder "3.7";
+
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-h9JgYq9KxmknaRuMgq+5YWA8tUaFk+lclkqdNAnr/cI=";
+  };
+
+  nativeBuildInputs = [ cython ];
+
+  buildInputs = [ zlib ];
+
+  # Too complicated to get to work, not a simple pytest call.
+  doCheck = false;
+
+  pythonImportsCheck = [ "indexed_gzip" ];
+
+  meta = with lib; {
+    description = "Python library to seek within compressed gzip files";
+    homepage = "https://github.com/pauldmccarthy/indexed_gzip";
+    license = licenses.zlib;
+    maintainers = with lib.maintainers; [ mxmlnkn ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 22dc7d04b589..f0d6e39504ee 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -5178,6 +5178,8 @@ self: super: with self; {
 
   indexed-bzip2 = callPackage ../development/python-modules/indexed-bzip2 { };
 
+  indexed-gzip = callPackage ../development/python-modules/indexed-gzip { inherit (pkgs) zlib; };
+
   infinity = callPackage ../development/python-modules/infinity { };
 
   inflect = callPackage ../development/python-modules/inflect { };