python312Packages.gradio: 5.11.0 -> 5.20.0 (#382974)

authored by Gaétan Lepage and committed by GitHub 2ffed2bc 172dc331

+118 -71
+10 -7
pkgs/development/python-modules/gradio-pdf/default.nix
··· 1 1 { 2 2 lib, 3 3 buildPythonPackage, 4 - fetchPypi, 4 + fetchFromGitHub, 5 5 hatch-fancy-pypi-readme, 6 6 hatch-requirements-txt, 7 7 hatchling, ··· 9 9 gradio-client, 10 10 }: 11 11 12 - buildPythonPackage rec { 12 + buildPythonPackage { 13 13 pname = "gradio-pdf"; 14 - version = "0.0.19"; 14 + version = "0.0.22"; 15 15 pyproject = true; 16 16 17 - src = fetchPypi { 18 - pname = "gradio_pdf"; 19 - inherit version; 20 - hash = "sha256-UVHNyKU2cl/0HZqntnyBOFmgeIJ6UjJejEqKqFIPdoo="; 17 + src = fetchFromGitHub { 18 + owner = "freddyaboulton"; 19 + repo = "gradio-pdf"; 20 + # No source release on Pypi 21 + # No tags on GitHub 22 + rev = "8833e9cd419d2a5eeff98e3ae8cbe690913bcfce"; 23 + hash = "sha256-z9rfVnH2qANDp2ukUGSogADbwqQQzCkB7Cp/04UtEpM="; 21 24 }; 22 25 23 26 build-system = [
+20 -20
pkgs/development/python-modules/gradio/client.nix
··· 4 4 buildPythonPackage, 5 5 fetchFromGitHub, 6 6 nix-update-script, 7 - pythonOlder, 8 - # pyproject 7 + 8 + # build-system 9 9 hatchling, 10 10 hatch-requirements-txt, 11 11 hatch-fancy-pypi-readme, 12 - # runtime 12 + 13 + # dependencies 13 14 setuptools, 14 15 fsspec, 15 16 httpx, ··· 17 18 packaging, 18 19 typing-extensions, 19 20 websockets, 20 - # checkInputs 21 - pytestCheckHook, 22 - pytest-asyncio, 21 + 22 + # tests 23 + gradio, 23 24 pydub, 25 + pytest-asyncio, 26 + pytestCheckHook, 24 27 rich, 25 - tomlkit, 26 - gradio, 27 28 safehttpx, 29 + tomlkit, 30 + writableTmpDirAsHomeHook, 28 31 }: 29 32 30 33 buildPythonPackage rec { 31 34 pname = "gradio-client"; 32 - version = "1.5.3"; 35 + version = "1.7.2"; 33 36 pyproject = true; 34 - 35 - disabled = pythonOlder "3.8"; 36 37 37 38 # no tests on pypi 38 39 src = fetchFromGitHub { ··· 41 42 # not to be confused with @gradio/client@${version} 42 43 tag = "gradio_client@${version}"; 43 44 sparseCheckout = [ "client/python" ]; 44 - hash = "sha256-u4GQYtCeAMDqRRbZGtjfqIHwuHyxUpw6kRE75SJMALg="; 45 + hash = "sha256-9hEls6f3aBNg7W2RGhu68mJSGlUScpNqMGsdHxTGyRY="; 45 46 }; 46 - prePatch = '' 47 - cd client/python 48 - ''; 47 + 48 + sourceRoot = "${src.name}/client/python"; 49 49 50 50 # upstream adds upper constraints because they can, not because the need to 51 51 # https://github.com/gradio-app/gradio/pull/4885 ··· 71 71 ]; 72 72 73 73 nativeCheckInputs = [ 74 + gradio.sans-reverse-dependencies 75 + pydub 76 + pytest-asyncio 74 77 pytestCheckHook 75 - pytest-asyncio 76 - pydub 77 78 rich 78 - tomlkit 79 79 safehttpx 80 - gradio.sans-reverse-dependencies 80 + tomlkit 81 + writableTmpDirAsHomeHook 81 82 ]; 82 83 # ensuring we don't propagate this intermediate build 83 84 disallowedReferences = [ gradio.sans-reverse-dependencies ]; 84 85 85 86 # Add a pytest hook skipping tests that access network, marking them as "Expected fail" (xfail). 86 87 preCheck = '' 87 - export HOME=$TMPDIR 88 88 cat ${./conftest-skip-network-errors.py} >> test/conftest.py 89 89 ''; 90 90
+45 -44
pkgs/development/python-modules/gradio/default.nix
··· 2 2 lib, 3 3 stdenv, 4 4 buildPythonPackage, 5 - fetchPypi, 6 5 fetchFromGitHub, 7 - fetchpatch, 8 - pythonOlder, 9 6 writeShellScriptBin, 10 7 gradio, 11 8 12 - # pyproject 9 + # build-system 13 10 hatchling, 14 11 hatch-requirements-txt, 15 12 hatch-fancy-pypi-readme, ··· 19 16 nodejs, 20 17 pnpm_9, 21 18 22 - # runtime 19 + # dependencies 23 20 setuptools, 24 21 aiofiles, 25 22 anyio, ··· 27 24 fastapi, 28 25 ffmpy, 29 26 gradio-client, 27 + groovy, 30 28 httpx, 31 29 huggingface-hub, 32 30 importlib-resources, ··· 53 51 authlib, 54 52 itsdangerous, 55 53 56 - # check 54 + # tests 57 55 pytestCheckHook, 58 56 hypothesis, 59 57 altair, ··· 68 66 tqdm, 69 67 transformers, 70 68 vega-datasets, 69 + writableTmpDirAsHomeHook, 71 70 }: 72 71 73 72 buildPythonPackage rec { 74 73 pname = "gradio"; 75 - version = "5.11.0"; 74 + version = "5.20.0"; 76 75 pyproject = true; 77 76 78 - disabled = pythonOlder "3.7"; 79 - 80 - # unfortunately no fetchPypi due to https://github.com/gradio-app/gradio/pull/9778 81 77 src = fetchFromGitHub { 82 78 owner = "gradio-app"; 83 79 repo = "gradio"; 84 80 tag = "gradio@${version}"; 85 - hash = "sha256-HW0J7oSkCo4DIHpU4LUoBZ2jmmrv5Xd64floA4uyo5A="; 81 + hash = "sha256-gAAyhsnc1LUcAvlUC5hftsWN1kSiRWqcQ4iKGpSIL+U="; 86 82 }; 87 83 88 84 pnpmDeps = pnpm_9.fetchDeps { 89 85 inherit pname version src; 90 - hash = "sha256-9fAkP2zV3OfyROdtvmS94ujpkGmlB0wGOaWS13LgJTM="; 91 - }; 92 - 93 - # fix packaging.ParserSyntaxError, which can't handle comments 94 - postPatch = '' 95 - sed -i -e "s/ #.*$//g" requirements*.txt 96 - ''; 86 + hash = "sha256-y0Bdupn19gEtwatc6Q3KD7aekXDk0xrq04LaG7gxMFI="; 87 + }; 97 88 98 89 pythonRelaxDeps = [ 99 - "tomlkit" 100 90 "aiofiles" 101 91 "markupsafe" 102 - "pillow" 103 92 ]; 104 93 105 94 pythonRemoveDeps = [ 106 - # our package is presented as a binary, not a python lib - and 107 95 # this isn't a real runtime dependency 108 96 "ruff" 109 97 ]; ··· 128 116 fastapi 129 117 ffmpy 130 118 gradio-client 119 + groovy 131 120 httpx 132 121 huggingface-hub 133 122 importlib-resources ··· 156 145 itsdangerous 157 146 ]; 158 147 159 - nativeCheckInputs = [ 160 - pytestCheckHook 161 - hypothesis 162 - altair 163 - boto3 164 - gradio-pdf 165 - ffmpeg 166 - ipython 167 - pytest-asyncio 168 - respx 169 - scikit-image 170 - # shap is needed as well, but breaks too often 171 - torch 172 - tqdm 173 - transformers 174 - vega-datasets 148 + nativeCheckInputs = 149 + [ 150 + pytestCheckHook 151 + hypothesis 152 + altair 153 + boto3 154 + gradio-pdf 155 + ffmpeg 156 + ipython 157 + pytest-asyncio 158 + respx 159 + scikit-image 160 + # shap is needed as well, but breaks too often 161 + torch 162 + tqdm 163 + transformers 164 + vega-datasets 175 165 176 - # mock calls to `shutil.which(...)` 177 - (writeShellScriptBin "npm" "false") 178 - ] ++ optional-dependencies.oauth ++ pydantic.optional-dependencies.email; 166 + # mock calls to `shutil.which(...)` 167 + (writeShellScriptBin "npm" "false") 168 + writableTmpDirAsHomeHook 169 + ] 170 + ++ optional-dependencies.oauth 171 + ++ pydantic.optional-dependencies.email; 179 172 180 173 preBuild = '' 181 174 pnpm build ··· 191 184 # We additionally xfail FileNotFoundError, since the gradio devs often fail to upload test assets to pypi. 192 185 preCheck = 193 186 '' 194 - export HOME=$TMPDIR 195 187 cat ${./conftest-skip-network-errors.py} >> test/conftest.py 196 188 '' 189 + # OSError: [Errno 24] Too many open files 197 190 + lib.optionalString stdenv.hostPlatform.isDarwin '' 198 - # OSError: [Errno 24] Too many open files 199 191 ulimit -n 4096 200 192 ''; 201 193 ··· 250 242 "test_get_executable_path" 251 243 ] 252 244 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 245 + # TypeError: argument should be a str or an os.PathLike object where __fspath__ returns a str, not 'NoneType' 246 + "test_component_example_values" 247 + "test_component_functions" 248 + "test_public_request_pass" 249 + 250 + # Failed: DID NOT RAISE <class 'ValueError'> 251 + # test.conftest.NixNetworkAccessDeniedError 252 + "test_private_request_fail" 253 + "test_theme_builder_launches" 254 + 253 255 # flaky on darwin (depend on port availability) 254 256 "test_all_status_messages" 255 257 "test_async_generators" ··· 316 318 ]; 317 319 318 320 # check the binary works outside the build env 319 - doInstallCheck = true; 320 - postInstallCheck = '' 321 + postCheck = '' 321 322 env --ignore-environment $out/bin/gradio environment >/dev/null 322 323 ''; 323 324
+41
pkgs/development/python-modules/groovy/default.nix
··· 1 + { 2 + lib, 3 + buildPythonPackage, 4 + fetchPypi, 5 + hatchling, 6 + gradio, 7 + pytestCheckHook, 8 + }: 9 + 10 + buildPythonPackage rec { 11 + pname = "groovy"; 12 + version = "0.1.2"; 13 + pyproject = true; 14 + 15 + src = fetchPypi { 16 + inherit pname version; 17 + hash = "sha256-JcHcCbP51+KSRYqnYsa+uW6gNwcb9ekX/IH7eNIjEIM="; 18 + }; 19 + 20 + build-system = [ 21 + hatchling 22 + ]; 23 + 24 + pythonImportsCheck = [ "groovy" ]; 25 + 26 + nativeCheckInputs = [ 27 + gradio 28 + pytestCheckHook 29 + ]; 30 + 31 + # Attempts to load a cert file 32 + # FileNotFoundError: [Errno 2] No such file or directory 33 + doCheck = false; 34 + 35 + meta = { 36 + description = "Small Python library created to help developers protect their applications from Server Side Request Forgery (SSRF) attacks"; 37 + homepage = "https://pypi.org/project/groovy"; 38 + license = lib.licenses.asl20; 39 + maintainers = with lib.maintainers; [ GaetanLepage ]; 40 + }; 41 + }
+2
pkgs/top-level/python-packages.nix
··· 5724 5724 5725 5725 groestlcoin-hash = callPackage ../development/python-modules/groestlcoin-hash { }; 5726 5726 5727 + groovy = callPackage ../development/python-modules/groovy { }; 5728 + 5727 5729 grpc-google-iam-v1 = callPackage ../development/python-modules/grpc-google-iam-v1 { }; 5728 5730 5729 5731 grpc-interceptor = callPackage ../development/python-modules/grpc-interceptor { };