python312Packages.gradio: 5.1.0 -> 5.11.0 (#371430)

authored by Peder Bergebakken Sundt and committed by GitHub d033c5a0 bd641be4

+107 -11
+5 -3
pkgs/development/python-modules/gradio/client.nix
··· 24 24 rich, 25 25 tomlkit, 26 26 gradio, 27 + safehttpx, 27 28 }: 28 29 29 30 buildPythonPackage rec { 30 31 pname = "gradio-client"; 31 - version = "1.4.0"; 32 + version = "1.5.3"; 32 33 pyproject = true; 33 34 34 35 disabled = pythonOlder "3.8"; ··· 38 39 owner = "gradio-app"; 39 40 repo = "gradio"; 40 41 # not to be confused with @gradio/client@${version} 41 - rev = "refs/tags/gradio_client@${version}"; 42 + tag = "gradio_client@${version}"; 42 43 sparseCheckout = [ "client/python" ]; 43 - hash = "sha256-pS7yrqBuq/Pe7sEfReAM6OL2qFQVA+vWra36UuhyDkk="; 44 + hash = "sha256-u4GQYtCeAMDqRRbZGtjfqIHwuHyxUpw6kRE75SJMALg="; 44 45 }; 45 46 prePatch = '' 46 47 cd client/python ··· 75 76 pydub 76 77 rich 77 78 tomlkit 79 + safehttpx 78 80 gradio.sans-reverse-dependencies 79 81 ]; 80 82 # ensuring we don't propagate this intermediate build
+62 -8
pkgs/development/python-modules/gradio/default.nix
··· 3 3 stdenv, 4 4 buildPythonPackage, 5 5 fetchPypi, 6 + fetchFromGitHub, 7 + fetchpatch, 6 8 pythonOlder, 7 9 writeShellScriptBin, 8 10 gradio, ··· 12 14 hatch-requirements-txt, 13 15 hatch-fancy-pypi-readme, 14 16 17 + # web assets 18 + zip, 19 + nodejs, 20 + pnpm_9, 21 + 15 22 # runtime 16 23 setuptools, 17 24 aiofiles, ··· 35 42 python-multipart, 36 43 pydub, 37 44 pyyaml, 45 + safehttpx, 38 46 semantic-version, 39 47 typing-extensions, 40 48 uvicorn, ··· 64 72 65 73 buildPythonPackage rec { 66 74 pname = "gradio"; 67 - version = "5.1.0"; 75 + version = "5.11.0"; 68 76 pyproject = true; 69 77 70 78 disabled = pythonOlder "3.7"; 71 79 72 - # We use the Pypi release, since it provides prebuilt webui assets 73 - src = fetchPypi { 74 - inherit pname version; 75 - hash = "sha256-0hU2aObeLfegG7M/AaB0/HcW7IY8QPRy2OQ5Q57x4VM="; 80 + # unfortunately no fetchPypi due to https://github.com/gradio-app/gradio/pull/9778 81 + src = fetchFromGitHub { 82 + owner = "gradio-app"; 83 + repo = "gradio"; 84 + tag = "gradio@${version}"; 85 + hash = "sha256-HW0J7oSkCo4DIHpU4LUoBZ2jmmrv5Xd64floA4uyo5A="; 76 86 }; 77 87 88 + pnpmDeps = pnpm_9.fetchDeps { 89 + inherit pname version src; 90 + hash = "sha256-9fAkP2zV3OfyROdtvmS94ujpkGmlB0wGOaWS13LgJTM="; 91 + }; 92 + 78 93 # fix packaging.ParserSyntaxError, which can't handle comments 79 94 postPatch = '' 80 95 sed -i -e "s/ #.*$//g" requirements*.txt 81 - 82 - # they bundle deps? 83 - rm -rf venv/ 84 96 ''; 85 97 86 98 pythonRelaxDeps = [ ··· 94 106 # our package is presented as a binary, not a python lib - and 95 107 # this isn't a real runtime dependency 96 108 "ruff" 109 + ]; 110 + 111 + nativeBuildInputs = [ 112 + zip 113 + nodejs 114 + pnpm_9.configHook 97 115 ]; 98 116 99 117 build-system = [ ··· 125 143 python-multipart 126 144 pydub 127 145 pyyaml 146 + safehttpx 128 147 semantic-version 129 148 typing-extensions 130 149 uvicorn ··· 158 177 (writeShellScriptBin "npm" "false") 159 178 ] ++ optional-dependencies.oauth ++ pydantic.optional-dependencies.email; 160 179 180 + preBuild = '' 181 + pnpm build 182 + pnpm package 183 + ''; 184 + 185 + postBuild = '' 186 + # SyntaxError: 'await' outside function 187 + zip -d dist/gradio-*.whl gradio/_frontend_code/lite/examples/transformers_basic/run.py 188 + ''; 189 + 161 190 # Add a pytest hook skipping tests that access network, marking them as "Expected fail" (xfail). 162 191 # We additionally xfail FileNotFoundError, since the gradio devs often fail to upload test assets to pypi. 163 192 preCheck = ··· 193 222 194 223 # fails without network 195 224 "test_download_if_url_correct_parse" 225 + "test_encode_url_to_base64_doesnt_encode_errors" 196 226 197 227 # flaky: OSError: Cannot find empty port in range: 7860-7959 198 228 "test_docs_url" 199 229 "test_orjson_serialization" 200 230 "test_dataset_is_updated" 201 231 "test_multimodal_api" 232 + "test_examples_keep_all_suffixes" 233 + "test_progress_bar" 234 + "test_progress_bar_track_tqdm" 235 + "test_info_and_warning_alerts" 236 + "test_info_isolation[True]" 237 + "test_info_isolation[False]" 238 + "test_examples_no_cache_optional_inputs" 239 + "test_start_server[127.0.0.1]" 240 + "test_start_server[[::1]]" 241 + "test_single_request" 242 + "test_all_status_messages" 243 + "test_default_concurrency_limits[not_set-statuses0]" 244 + "test_default_concurrency_limits[None-statuses1]" 245 + "test_default_concurrency_limits[1-statuses2]" 246 + "test_default_concurrency_limits[2-statuses3]" 247 + "test_concurrency_limits" 202 248 203 249 # tests if pip and other tools are installed 204 250 "test_get_executable_path" ··· 256 302 disabledTestPaths = [ 257 303 # 100% touches network 258 304 "test/test_networking.py" 305 + "client/python/test/test_client.py" 259 306 # makes pytest freeze 50% of the time 260 307 "test/test_interfaces.py" 261 308 ··· 289 336 doInstallCheck = false; 290 337 doCheck = false; 291 338 preCheck = ""; 339 + postInstall = '' 340 + shopt -s globstar 341 + for f in $out/**/*.py; do 342 + cp $f "$f"i 343 + done 344 + shopt -u globstar 345 + ''; 292 346 pythonImportsCheck = null; 293 347 dontCheckRuntimeDeps = true; 294 348 });
+38
pkgs/development/python-modules/safehttpx/default.nix
··· 1 + { 2 + lib, 3 + buildPythonPackage, 4 + fetchPypi, 5 + hatchling, 6 + httpx, 7 + pythonOlder, 8 + }: 9 + 10 + buildPythonPackage rec { 11 + pname = "safehttpx"; 12 + version = "0.1.6"; 13 + pyproject = true; 14 + 15 + src = fetchPypi { 16 + inherit pname version; 17 + hash = "sha256-s1a/yCzuOiTDlblKLb6rvtYK/xql+jtf6XxPJFbrzkI="; 18 + }; 19 + 20 + build-system = [ 21 + hatchling 22 + ]; 23 + 24 + dependencies = [ 25 + httpx 26 + ]; 27 + 28 + pythonImportsCheck = [ "safehttpx" ]; 29 + 30 + doCheck = false; # require network access 31 + 32 + meta = { 33 + description = "SSRF-safe wrapper around httpx"; 34 + homepage = "https://github.com/gradio-app/safehttpx"; 35 + license = lib.licenses.asl20; 36 + maintainers = with lib.maintainers; [ fliegendewurst ]; 37 + }; 38 + }
+2
pkgs/top-level/python-packages.nix
··· 14418 14418 14419 14419 safe-pysha3 = callPackage ../development/python-modules/safe-pysha3 { }; 14420 14420 14421 + safehttpx = callPackage ../development/python-modules/safehttpx { }; 14422 + 14421 14423 safeio = callPackage ../development/python-modules/safeio { }; 14422 14424 14423 14425 safetensors = callPackage ../development/python-modules/safetensors { };