From ed2cb7927b725cc021bb94fd1c26e5e194fffb30 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Fri, 15 Dec 2023 00:15:54 +0100 Subject: [PATCH] python3Packages.gradio-client: 0.5.0 -> 0.7.3 --- .../python-modules/gradio/client.nix | 27 ++++++++++++++----- .../gradio/conftest-skip-network-errors.py | 2 ++ 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/gradio/client.nix b/pkgs/development/python-modules/gradio/client.nix index ce866a67b4cc..b2d88af22e6e 100644 --- a/pkgs/development/python-modules/gradio/client.nix +++ b/pkgs/development/python-modules/gradio/client.nix @@ -20,6 +20,8 @@ , pytestCheckHook , pytest-asyncio , pydub +, rich +, tomlkit , gradio }: @@ -30,18 +32,20 @@ let gradio' = (gradio.override (old: { gradio-client = null; })).overridePythonAttrs (old: { + pname = old.pname + "-sans-client"; nativeBuildInputs = (old.nativeBuildInputs or []) ++ [ pythonRelaxDepsHook ]; - pythonRemoveDeps = (old.pythonRemoveDeps or []) ++ [ "gradio_client" ]; + pythonRemoveDeps = (old.pythonRemoveDeps or []) ++ [ "gradio-client" ]; doInstallCheck = false; doCheck = false; pythonImportsCheck = null; + dontCheckRuntimeDeps = true; }); in buildPythonPackage rec { - pname = "gradio_client"; - version = "0.5.0"; + pname = "gradio-client"; + version = "0.7.3"; format = "pyproject"; disabled = pythonOlder "3.8"; @@ -51,18 +55,26 @@ buildPythonPackage rec { owner = "gradio-app"; repo = "gradio"; #rev = "refs/tags/v${gradio.version}"; - rev = "ba4c6d9e65138c97062d1757d2a588c4fc449daa"; # v3.43.1 is not tagged... + rev = "dc131b64f05062447643217819ca630e483a11df"; # v4.9.1 is not tagged... sparseCheckout = [ "client/python" ]; - hash = "sha256-savka4opyZKSWPeBqc2LZqvwVXLYIZz5dS1OWJSwvHo="; + hash = "sha256-Zp1Zl53Va0pyyZEHDUpnldi4dtH2uss7PZQD+Le8+cA="; }; prePatch = '' cd client/python ''; + # upstream adds upper constraints because they can, not because the need to + # https://github.com/gradio-app/gradio/pull/4885 + pythonRelaxDeps = [ + # only backward incompat is dropping py3.7 support + "websockets" + ]; + nativeBuildInputs = [ hatchling hatch-requirements-txt hatch-fancy-pypi-readme + pythonRelaxDepsHook ]; propagatedBuildInputs = [ @@ -71,7 +83,6 @@ buildPythonPackage rec { httpx huggingface-hub packaging - requests typing-extensions websockets ]; @@ -80,6 +91,8 @@ buildPythonPackage rec { pytestCheckHook pytest-asyncio pydub + rich + tomlkit gradio' ]; disallowedReferences = [ @@ -94,7 +107,7 @@ buildPythonPackage rec { pytestFlagsArray = [ "test/" - #"-m" "not flaky" # doesn't work, even when advertised + "-m 'not flaky'" #"-x" "-W" "ignore" # uncomment for debugging help ]; diff --git a/pkgs/development/python-modules/gradio/conftest-skip-network-errors.py b/pkgs/development/python-modules/gradio/conftest-skip-network-errors.py index 4738de317552..eb2385bca8d6 100644 --- a/pkgs/development/python-modules/gradio/conftest-skip-network-errors.py +++ b/pkgs/development/python-modules/gradio/conftest-skip-network-errors.py @@ -28,6 +28,8 @@ def pytest_runtest_makereport(item, call): for exc in iterate_exc_chain(call.excinfo.value): if isinstance(exc, NixNetworkAccessDeniedError): tr.outcome, tr.wasxfail = 'skipped', "reason: Requires network access." + if isinstance(exc, httpx.ConnectError): + tr.outcome, tr.wasxfail = 'skipped', "reason: Requires network access." if isinstance(exc, FileNotFoundError): # gradio specific tr.outcome, tr.wasxfail = 'skipped', "reason: Pypi dist bad." return tr