about summary refs log tree commit diff
path: root/pkgs/development/python-modules/gradio/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/gradio/default.nix')
-rw-r--r--pkgs/development/python-modules/gradio/default.nix173
1 files changed, 88 insertions, 85 deletions
diff --git a/pkgs/development/python-modules/gradio/default.nix b/pkgs/development/python-modules/gradio/default.nix
index 0d4838e372de6..3568ae9d1d82f 100644
--- a/pkgs/development/python-modules/gradio/default.nix
+++ b/pkgs/development/python-modules/gradio/default.nix
@@ -1,68 +1,69 @@
-{ lib
-, stdenv
-, buildPythonPackage
-, fetchPypi
-, pythonOlder
-, pythonRelaxDepsHook
-, writeShellScriptBin
-, gradio
-
-# pyproject
-, hatchling
-, hatch-requirements-txt
-, hatch-fancy-pypi-readme
-
-# runtime
-, setuptools
-, aiofiles
-, altair
-, diffusers
-, fastapi
-, ffmpy
-, gradio-client
-, httpx
-, huggingface-hub
-, importlib-resources
-, jinja2
-, markupsafe
-, matplotlib
-, numpy
-, orjson
-, packaging
-, pandas
-, pillow
-, pydantic
-, python-multipart
-, pydub
-, pyyaml
-, semantic-version
-, typing-extensions
-, uvicorn
-, typer
-, tomlkit
-
-# oauth
-, authlib
-, itsdangerous
-
-# check
-, pytestCheckHook
-, boto3
-, gradio-pdf
-, ffmpeg
-, ipython
-, pytest-asyncio
-, respx
-, scikit-image
-, torch
-, tqdm
-, transformers
-, vega-datasets
+{
+  lib,
+  stdenv,
+  buildPythonPackage,
+  fetchPypi,
+  pythonOlder,
+  pythonRelaxDepsHook,
+  writeShellScriptBin,
+  gradio,
+
+  # pyproject
+  hatchling,
+  hatch-requirements-txt,
+  hatch-fancy-pypi-readme,
+
+  # runtime
+  setuptools,
+  aiofiles,
+  altair,
+  diffusers,
+  fastapi,
+  ffmpy,
+  gradio-client,
+  httpx,
+  huggingface-hub,
+  importlib-resources,
+  jinja2,
+  markupsafe,
+  matplotlib,
+  numpy,
+  orjson,
+  packaging,
+  pandas,
+  pillow,
+  pydantic,
+  python-multipart,
+  pydub,
+  pyyaml,
+  semantic-version,
+  typing-extensions,
+  uvicorn,
+  typer,
+  tomlkit,
+
+  # oauth
+  authlib,
+  itsdangerous,
+
+  # check
+  pytestCheckHook,
+  boto3,
+  gradio-pdf,
+  ffmpeg,
+  ipython,
+  pytest-asyncio,
+  respx,
+  scikit-image,
+  torch,
+  tqdm,
+  transformers,
+  vega-datasets,
 }:
 
 buildPythonPackage rec {
   pname = "gradio";
-  version = "4.27.0";
+  version = "4.29.0";
   format = "pyproject";
 
   disabled = pythonOlder "3.7";
@@ -71,7 +72,7 @@ buildPythonPackage rec {
   # and upstream has stopped tagging releases since 3.41.0
   src = fetchPypi {
     inherit pname version;
-    hash = "sha256-617zutFhS8NGO4+fcALH8aKbk+reGC65DNWKVVKiWEw=";
+    hash = "sha256-17KT0b9kBO+xLgIgxfpwjETDoRM4aTJPlJv7HjkJXjo=";
   };
 
   # fix packaging.ParserSyntaxError, which can't handle comments
@@ -82,9 +83,7 @@ buildPythonPackage rec {
     rm -rf venv/
   '';
 
-  pythonRelaxDeps = [
-    "tomlkit"
-  ];
+  pythonRelaxDeps = [ "tomlkit" ];
 
   pythonRemoveDeps = [
     # our package is presented as a binary, not a python lib - and
@@ -151,19 +150,19 @@ buildPythonPackage rec {
 
     # mock calls to `shutil.which(...)`
     (writeShellScriptBin "npm" "false")
-  ]
-  ++ passthru.optional-dependencies.oauth
-  ++ 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.
-  preCheck = ''
-    export HOME=$TMPDIR
-    cat ${./conftest-skip-network-errors.py} >> test/conftest.py
-  '' + lib.optionalString stdenv.isDarwin ''
-    # OSError: [Errno 24] Too many open files
-    ulimit -n 4096
-  '';
+  preCheck =
+    ''
+      export HOME=$TMPDIR
+      cat ${./conftest-skip-network-errors.py} >> test/conftest.py
+    ''
+    + lib.optionalString stdenv.isDarwin ''
+      # OSError: [Errno 24] Too many open files
+      ulimit -n 4096
+    '';
 
   disabledTests = [
     # Actually broken
@@ -197,11 +196,13 @@ buildPythonPackage rec {
     "test/test_interfaces.py"
   ];
   pytestFlagsArray = [
-    "-x"  # abort on first failure
+    "-x" # abort on first failure
     "-m 'not flaky'"
     #"-W" "ignore" # uncomment for debugging help
   ];
 
+  __darwinAllowLocalNetworking = true;
+
   # check the binary works outside the build env
   doInstallCheck = true;
   postInstallCheck = ''
@@ -212,17 +213,19 @@ 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-reverse-dependencies";
-      pythonRemoveDeps = (old.pythonRemoveDeps or []) ++ [ "gradio-client" ];
-      doInstallCheck = false;
-      doCheck = false;
-      pythonImportsCheck = null;
-      dontCheckRuntimeDeps = true;
-    });
+    })).overridePythonAttrs
+      (old: {
+        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/";