python3Packages.gradio: 6.8.0 -> 6.9.0 (#497989)
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
lib,
|
||||
stdenv,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
gitUpdater,
|
||||
nix-update-script,
|
||||
jq,
|
||||
|
||||
# build-system
|
||||
hatchling,
|
||||
@@ -32,24 +32,12 @@
|
||||
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "gradio-client";
|
||||
version = "2.2.0";
|
||||
version = "2.3.0";
|
||||
pyproject = true;
|
||||
|
||||
# no tests on pypi
|
||||
src = fetchFromGitHub {
|
||||
owner = "gradio-app";
|
||||
repo = "gradio";
|
||||
# not to be confused with @gradio/client@${version}
|
||||
# tag = "gradio_client@${finalAttrs.version}";
|
||||
# TODO: switch back to a tag next release, if they tag it.
|
||||
rev = "8b03393a51e1e03fb04cb0a41b9a5dc3266a58aa"; # 2.2.0
|
||||
sparseCheckout = [
|
||||
"client/python"
|
||||
"gradio/media_assets"
|
||||
];
|
||||
hash = "sha256-LkTZwPyHe1w8D5unEMW7dBGKNHxM7gWJ7I+4HwiexKk=";
|
||||
};
|
||||
|
||||
# they've stopped tagging "gradio_client@.*" and "@gradio/client@.*" tags on github
|
||||
inherit (gradio) src;
|
||||
sourceRoot = "${finalAttrs.src.name}/client/python";
|
||||
|
||||
# Because we set sourceRoot above, the folders "client/python"
|
||||
@@ -59,6 +47,20 @@ buildPythonPackage (finalAttrs: {
|
||||
--replace-fail 'from client.python.test import media_data' 'import media_data'
|
||||
'';
|
||||
|
||||
preConfigure = ''
|
||||
# sanity check
|
||||
if [[ "$(jq <gradio_client/package.json .version -r)" != "$version" ]]; then
|
||||
echo >&2 "ERROR: version mismatch with package.json:"
|
||||
echo >&2 "version = $version"
|
||||
(set -x; cat >&2 gradio_client/package.json)
|
||||
false
|
||||
fi
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
jq
|
||||
];
|
||||
|
||||
build-system = [
|
||||
hatchling
|
||||
hatch-requirements-txt
|
||||
@@ -118,16 +120,15 @@ buildPythonPackage (finalAttrs: {
|
||||
|
||||
__darwinAllowLocalNetworking = true;
|
||||
|
||||
passthru.updateScript = gitUpdater {
|
||||
rev-prefix = "gradio_client@";
|
||||
ignoredVersions = ".*-(beta|dev).*";
|
||||
passthru = {
|
||||
inherit (gradio) updateScript;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Lightweight library to use any Gradio app as an API";
|
||||
homepage = "https://www.gradio.app/";
|
||||
downloadPage = "https://github.com/gradio-app/gradio/tree/main/client/python";
|
||||
# changelog = "https://github.com/gradio-app/gradio/releases/tag/${finalAttrs.src.tag}"; TODO: uncomment if the tag exists
|
||||
changelog = "https://github.com/gradio-app/gradio/blob/${finalAttrs.src.tag}/client/python/gradio_client/CHANGELOG.md";
|
||||
license = lib.licenses.asl20;
|
||||
maintainers = with lib.maintainers; [ pbsds ];
|
||||
};
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
|
||||
# tests
|
||||
pytestCheckHook,
|
||||
build,
|
||||
hypothesis,
|
||||
altair,
|
||||
boto3,
|
||||
@@ -81,14 +82,14 @@ let
|
||||
in
|
||||
buildPythonPackage (finalAttrs: {
|
||||
pname = "gradio";
|
||||
version = "6.8.0";
|
||||
version = "6.9.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "gradio-app";
|
||||
repo = "gradio";
|
||||
tag = "gradio@${finalAttrs.version}";
|
||||
hash = "sha256-ZHglnRs0AXCu9HlVoSO0h5p6SE4al/OLPn0jwZgKVR8=";
|
||||
hash = "sha256-iGaUiJto/tquCSa6D/wbkNyVtK/2kZB/hz62STfwLOY=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
@@ -103,7 +104,7 @@ buildPythonPackage (finalAttrs: {
|
||||
;
|
||||
inherit pnpm;
|
||||
fetcherVersion = 3;
|
||||
hash = "sha256-6Cx0hdVd0srhArvck2Kn9U2fT7aKtTZjgV5b/Usrnoo=";
|
||||
hash = "sha256-pZCYtWFNlrcRFomx6HbO0zySOyifO3n/ffzx59pS/A8=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
@@ -167,6 +168,7 @@ buildPythonPackage (finalAttrs: {
|
||||
boto3
|
||||
brotli
|
||||
diffusers
|
||||
build
|
||||
docker
|
||||
ffmpeg
|
||||
gradio-pdf
|
||||
@@ -214,6 +216,9 @@ buildPythonPackage (finalAttrs: {
|
||||
"test_error_analytics_successful"
|
||||
"TestSnippetExecution"
|
||||
|
||||
# requires network, via subprocess.run
|
||||
"test_endpoint_status"
|
||||
|
||||
# Flaky, tries to pin dependency behaviour. Sensitive to dep versions
|
||||
# These error only affect downstream use of the check dependencies.
|
||||
"test_no_color"
|
||||
@@ -254,6 +259,8 @@ buildPythonPackage (finalAttrs: {
|
||||
|
||||
# tests if pip and other tools are installed
|
||||
"test_get_executable_path"
|
||||
"test_api_response"
|
||||
"test_load_assets"
|
||||
|
||||
# Flaky test (AssertionError when comparing to a fixed array)
|
||||
# https://github.com/gradio-app/gradio/issues/11620
|
||||
@@ -356,6 +363,7 @@ buildPythonPackage (finalAttrs: {
|
||||
# 100% touches network
|
||||
"test/test_networking.py"
|
||||
"client/python/test/test_client.py"
|
||||
|
||||
# makes pytest freeze 50% of the time
|
||||
"test/test_interfaces.py"
|
||||
|
||||
@@ -422,7 +430,9 @@ buildPythonPackage (finalAttrs: {
|
||||
# enough tags for the ones we're looking for to show up.
|
||||
updateScript = writeScript "update-python3Packages.gradio" ''
|
||||
#! /usr/bin/env nix-shell
|
||||
#! nix-shell -i bash -p common-updater-scripts coreutils gnugrep gnused nix-update
|
||||
#! nix-shell -i bash -p common-updater-scripts coreutils gnugrep gnused nix-update jq curl
|
||||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
tag=$(list-git-tags \
|
||||
| grep "^gradio@" \
|
||||
@@ -432,7 +442,10 @@ buildPythonPackage (finalAttrs: {
|
||||
| head -n 1 \
|
||||
| tr -d '\n' \
|
||||
)
|
||||
nix-update --version="$tag"
|
||||
nix-update python3Packages.gradio --version="$tag"
|
||||
|
||||
gradio_client_version="$(curl https://raw.githubusercontent.com/gradio-app/gradio/gradio@"$tag"/client/python/gradio_client/package.json | jq ".version" -r)"
|
||||
nix-update python3Packages.gradio-client --version="$gradio_client_version" --no-src
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
@@ -6650,7 +6650,9 @@ self: super: with self; {
|
||||
|
||||
gradio = callPackage ../development/python-modules/gradio { };
|
||||
|
||||
gradio-client = callPackage ../development/python-modules/gradio/client.nix { };
|
||||
gradio-client = callPackage ../development/python-modules/gradio/client.nix {
|
||||
inherit (pkgs) jq;
|
||||
};
|
||||
|
||||
gradio-pdf = callPackage ../development/python-modules/gradio-pdf { };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user