about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorPeder Bergebakken Sundt <pbsds@hotmail.com>2024-03-26 16:56:26 +0100
committerGitHub <noreply@github.com>2024-03-26 16:56:26 +0100
commite46dc89e01f75959ea3bb62e83b51bdeb1887f72 (patch)
tree8cadd94f624149247fdca508e659bd5984226891 /pkgs/development
parent260cb37bd5e012f55b3f4f59a24f88b29621a481 (diff)
parent3937a5d97913a399d7ba4c0d60bf9b32b17965c0 (diff)
Merge pull request #298153 from pbsds/fix-gradio-1711133748
python311Packages.gradio: 4.20.1 -> 4.22.0
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/gradio/client.nix9
-rw-r--r--pkgs/development/python-modules/gradio/default.nix30
2 files changed, 28 insertions, 11 deletions
diff --git a/pkgs/development/python-modules/gradio/client.nix b/pkgs/development/python-modules/gradio/client.nix
index 8ad76a907581b..2c3abd4c0e785 100644
--- a/pkgs/development/python-modules/gradio/client.nix
+++ b/pkgs/development/python-modules/gradio/client.nix
@@ -1,6 +1,7 @@
 { lib
 , buildPythonPackage
 , fetchFromGitHub
+, gitUpdater
 , pythonOlder
 , pythonRelaxDepsHook
 # pyproject
@@ -27,7 +28,7 @@
 
 buildPythonPackage rec {
   pname = "gradio-client";
-  version = "0.10.1";
+  version = "0.14.0";
   format = "pyproject";
 
   disabled = pythonOlder "3.8";
@@ -36,9 +37,9 @@ buildPythonPackage rec {
   src = fetchFromGitHub {
     owner = "gradio-app";
     repo = "gradio";
-    rev = "refs/tags/gradio_client@${version}";
+    rev = "refs/tags/@gradio/client@${version}";
     sparseCheckout = [ "client/python" ];
-    hash = "sha256-cRsYqNMmzuybJI823lpUOmNcTdcTO8dJkp3cpjATZQU=";
+    hash = "sha256-7oC/Z3YUiOFZdv/60q7PkfluV77broRkHgWiY9Vim9Y=";
   };
   prePatch = ''
     cd client/python
@@ -95,6 +96,8 @@ buildPythonPackage rec {
 
   __darwinAllowLocalNetworking = true;
 
+  passthru.updateScript = gitUpdater { rev-prefix = "@gradio/client@"; };
+
   meta = with lib; {
     homepage = "https://www.gradio.app/";
     description = "Lightweight library to use any Gradio app as an API";
diff --git a/pkgs/development/python-modules/gradio/default.nix b/pkgs/development/python-modules/gradio/default.nix
index bfcf10a2ea1ce..69e57b821a69c 100644
--- a/pkgs/development/python-modules/gradio/default.nix
+++ b/pkgs/development/python-modules/gradio/default.nix
@@ -16,6 +16,7 @@
 , setuptools
 , aiofiles
 , altair
+, diffusers
 , fastapi
 , ffmpy
 , gradio-client
@@ -40,6 +41,10 @@
 , typer
 , tomlkit
 
+# oauth
+, authlib
+, itsdangerous
+
 # check
 , pytestCheckHook
 , boto3
@@ -57,7 +62,7 @@
 
 buildPythonPackage rec {
   pname = "gradio";
-  version = "4.20.1";
+  version = "4.22.0";
   format = "pyproject";
 
   disabled = pythonOlder "3.7";
@@ -66,7 +71,7 @@ buildPythonPackage rec {
   # and upstream has stopped tagging releases since 3.41.0
   src = fetchPypi {
     inherit pname version;
-    hash = "sha256-nvuIpOFib09FJGfkX0TDfb2LV/eDn3EybsFp5A3lzas=";
+    hash = "sha256-nhrT509xB3+R+HF6TF5AQGnfufT6iNmzjxZgcVL7fBo=";
   };
 
   # fix packaging.ParserSyntaxError, which can't handle comments
@@ -98,6 +103,7 @@ buildPythonPackage rec {
     setuptools # needed for 'pkg_resources'
     aiofiles
     altair
+    diffusers
     fastapi
     ffmpy
     gradio-client
@@ -123,6 +129,11 @@ buildPythonPackage rec {
     tomlkit
   ] ++ typer.passthru.optional-dependencies.all;
 
+  passthru.optional-dependencies.oauth = [
+    authlib
+    itsdangerous
+  ];
+
   nativeCheckInputs = [
     pytestCheckHook
     boto3
@@ -138,9 +149,11 @@ buildPythonPackage rec {
     transformers
     vega-datasets
 
-    # mock npm to make `shutil.which("npm")` pass
+    # mock calls to `shutil.which(...)`
     (writeShellScriptBin "npm" "false")
-  ] ++ pydantic.passthru.optional-dependencies.email;
+  ]
+  ++ passthru.optional-dependencies.oauth
+  ++ pydantic.passthru.optional-dependencies.email;
 
   # Add a pytest hook skipping tests that access network, marking them as "Expected fail" (xfail).
   # We additionally xfail FileNotFoundError, since the gradio devs often fail to upload test assets to pypi.
@@ -173,6 +186,9 @@ buildPythonPackage rec {
 
     # fails without network
     "test_download_if_url_correct_parse"
+
+    # tests if pip and other tools are installed
+    "test_get_executable_path"
   ];
   disabledTestPaths = [
     # 100% touches network
@@ -196,19 +212,17 @@ buildPythonPackage rec {
 
   # Cyclic dependencies are fun!
   # This is gradio without gradio-client and gradio-pdf
-  passthru = {
-    sans-reverse-dependencies = (gradio.override (old: {
+  passthru.sans-reverse-dependencies = (gradio.override (old: {
       gradio-client = null;
       gradio-pdf = null;
     })).overridePythonAttrs (old: {
-      pname = old.pname + "-sans-client";
+      pname = old.pname + "-sans-reverse-dependencies";
       pythonRemoveDeps = (old.pythonRemoveDeps or []) ++ [ "gradio-client" ];
       doInstallCheck = false;
       doCheck = false;
       pythonImportsCheck = null;
       dontCheckRuntimeDeps = true;
     });
-  };
 
   meta = with lib; {
     homepage = "https://www.gradio.app/";