From 0e64b8d5672da476fed52995e35c46156ce18d18 Mon Sep 17 00:00:00 2001 From: wrvsrx Date: Wed, 28 May 2025 02:24:25 +0800 Subject: [PATCH 1/2] python3Packages.starlette-compress: init at 0.16.0 --- .../starlette-compress/default.nix | 53 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 55 insertions(+) create mode 100644 pkgs/development/python-modules/starlette-compress/default.nix diff --git a/pkgs/development/python-modules/starlette-compress/default.nix b/pkgs/development/python-modules/starlette-compress/default.nix new file mode 100644 index 000000000000..970d665ae9a4 --- /dev/null +++ b/pkgs/development/python-modules/starlette-compress/default.nix @@ -0,0 +1,53 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + hatchling, + brotli, + brotlicffi, + starlette, + zstandard, + pytestCheckHook, + httpx, + trio, +}: + +buildPythonPackage rec { + pname = "starlette-compress"; + version = "1.6.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "Zaczero"; + repo = "starlette-compress"; + tag = version; + hash = "sha256-VEVPbCGE4BQo/0t/P785TyMHZGSKCicV6H0LbBsv8uo="; + }; + + build-system = [ hatchling ]; + + dependencies = [ + brotli + brotlicffi + starlette + zstandard + ]; + + checkInputs = [ + httpx + trio + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "starlette_compress" ]; + + meta = { + description = "Compression middleware for Starlette - supporting ZStd, Brotli, and GZip"; + homepage = "https://pypi.org/p/starlette-compress"; + license = lib.licenses.bsd0; + maintainers = with lib.maintainers; [ wrvsrx ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 16ed1fa0480e..322f955fc066 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -16726,6 +16726,8 @@ self: super: with self; { starlette-admin = callPackage ../development/python-modules/starlette-admin { }; + starlette-compress = callPackage ../development/python-modules/starlette-compress { }; + starlette-context = callPackage ../development/python-modules/starlette-context { }; starlette-wtf = callPackage ../development/python-modules/starlette-wtf { }; From 4d5d4ef221f6da06c8924ad26bd5099e8a85df15 Mon Sep 17 00:00:00 2001 From: wrvsrx Date: Wed, 28 May 2025 02:25:51 +0800 Subject: [PATCH 2/2] open-webui: 0.6.10 -> 0.6.11 --- pkgs/by-name/op/open-webui/package.nix | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/op/open-webui/package.nix b/pkgs/by-name/op/open-webui/package.nix index 036a1767ed82..207f7c8c9e6c 100644 --- a/pkgs/by-name/op/open-webui/package.nix +++ b/pkgs/by-name/op/open-webui/package.nix @@ -2,7 +2,6 @@ lib, buildNpmPackage, fetchFromGitHub, - fetchpatch2, python3Packages, nixosTests, fetchurl, @@ -10,28 +9,19 @@ }: let pname = "open-webui"; - version = "0.6.10"; + version = "0.6.11"; src = fetchFromGitHub { owner = "open-webui"; repo = "open-webui"; tag = "v${version}"; - hash = "sha256-OZPZlF6tXzfuFU8/ZavE67E8+XdRu+7oCA1eD0EA9fg="; + hash = "sha256-G5rbSClztrphQwVYoBvfFTZ/dPHCuxL1PdZZhSy2RbQ="; }; frontend = buildNpmPackage rec { pname = "open-webui-frontend"; inherit version src; - patches = [ - # Git is not available in the sandbox - # Remove this patch at the next release - (fetchpatch2 { - url = "https://github.com/open-webui/open-webui/commit/ed0659aca60eedadadba4362b309015b4a8368c6.patch"; - hash = "sha256-lTzCdAk9gagIfN5Ld1tCS3gp/oVm4+CRy/lD42702WM="; - }) - ]; - # the backend for run-on-client-browser python execution # must match lock file in open-webui # TODO: should we automate this? @@ -42,7 +32,7 @@ let url = "https://github.com/pyodide/pyodide/releases/download/${pyodideVersion}/pyodide-${pyodideVersion}.tar.bz2"; }; - npmDepsHash = "sha256-F/xum76SHFwX/77kPHTFayJ00wv6ZWE09hw8taUbMMQ="; + npmDepsHash = "sha256-qQzAehIXMWyXmz7jT0aU6zsSXi3WVcOjchcA+3M7tAU="; # Disabling `pyodide:fetch` as it downloads packages during `buildPhase` # Until this is solved, running python packages from the browser will not work. @@ -197,6 +187,7 @@ python3Packages.buildPythonApplication rec { sentence-transformers sentencepiece soundfile + starlette-compress tencentcloud-sdk-python tiktoken transformers