diff --git a/pkgs/development/python-modules/stream-unzip/default.nix b/pkgs/development/python-modules/stream-unzip/default.nix new file mode 100644 index 000000000000..298313d11d13 --- /dev/null +++ b/pkgs/development/python-modules/stream-unzip/default.nix @@ -0,0 +1,69 @@ +{ + lib, + buildPythonPackage, + cargo, + fetchFromGitHub, + nix-update-script, + pycryptodome, + pyprojectVersionPatchHook, + rustc, + rustPlatform, + stream-inflate, + trio, +}: + +buildPythonPackage (finalAttrs: { + pname = "stream-unzip"; + version = "0.0.101"; + pyproject = true; + + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "uktrade"; + repo = "stream-unzip"; + tag = "v${finalAttrs.version}"; + hash = "sha256-JTMJdc61wR2nqYq3BMkLgi+krKsDUKBAgzbqlvYx8L0="; + }; + + cargoDeps = rustPlatform.fetchCargoVendor { + inherit (finalAttrs) pname version src; + hash = "sha256-CKtu4ERN0L7XoZxFAQhgZSymLqGkBdP0eSy9DhFPwZk="; + }; + + build-system = [ + cargo + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + rustc + ]; + + nativeBuildInputs = [ pyprojectVersionPatchHook ]; + + dependencies = [ + pycryptodome + stream-inflate + ]; + + optional-dependencies = { + ci = [ + pycryptodome + stream-inflate + ]; + }; + + # Module has no tests + doCheck = false; + + pythonImportsCheck = [ "stream_unzip" ]; + + passthru.updateScript = nix-update-script { }; + + meta = { + description = "Python function to stream unzip all the files in a ZIP archive on the fly"; + homepage = "https://github.com/uktrade/stream-unzip"; + changelog = "https://github.com/uktrade/stream-unzip/releases/tag/${finalAttrs.src.tag}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ fab ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bb388398c7db..840703d07781 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19954,6 +19954,8 @@ self: super: with self; { stream-inflate = callPackage ../development/python-modules/stream-inflate { }; + stream-unzip = callPackage ../development/python-modules/stream-unzip { }; + streamcontroller-plugin-tools = callPackage ../development/python-modules/streamcontroller-plugin-tools { };