Skip to content

Commit 2ffed2b

Browse files
authored
python312Packages.gradio: 5.11.0 -> 5.20.0 (#382974)
2 parents 172dc33 + 78f5404 commit 2ffed2b

File tree

5 files changed

+119
-72
lines changed

5 files changed

+119
-72
lines changed

pkgs/development/python-modules/gradio-pdf/default.nix

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,26 @@
11
{
22
lib,
33
buildPythonPackage,
4-
fetchPypi,
4+
fetchFromGitHub,
55
hatch-fancy-pypi-readme,
66
hatch-requirements-txt,
77
hatchling,
88
gradio,
99
gradio-client,
1010
}:
1111

12-
buildPythonPackage rec {
12+
buildPythonPackage {
1313
pname = "gradio-pdf";
14-
version = "0.0.19";
14+
version = "0.0.22";
1515
pyproject = true;
1616

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=";
2124
};
2225

2326
build-system = [

pkgs/development/python-modules/gradio/client.nix

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,48 @@
44
buildPythonPackage,
55
fetchFromGitHub,
66
nix-update-script,
7-
pythonOlder,
8-
# pyproject
7+
8+
# build-system
99
hatchling,
1010
hatch-requirements-txt,
1111
hatch-fancy-pypi-readme,
12-
# runtime
12+
13+
# dependencies
1314
setuptools,
1415
fsspec,
1516
httpx,
1617
huggingface-hub,
1718
packaging,
1819
typing-extensions,
1920
websockets,
20-
# checkInputs
21-
pytestCheckHook,
22-
pytest-asyncio,
21+
22+
# tests
23+
gradio,
2324
pydub,
25+
pytest-asyncio,
26+
pytestCheckHook,
2427
rich,
25-
tomlkit,
26-
gradio,
2728
safehttpx,
29+
tomlkit,
30+
writableTmpDirAsHomeHook,
2831
}:
2932

3033
buildPythonPackage rec {
3134
pname = "gradio-client";
32-
version = "1.5.3";
35+
version = "1.7.2";
3336
pyproject = true;
3437

35-
disabled = pythonOlder "3.8";
36-
3738
# no tests on pypi
3839
src = fetchFromGitHub {
3940
owner = "gradio-app";
4041
repo = "gradio";
4142
# not to be confused with @gradio/client@${version}
4243
tag = "gradio_client@${version}";
4344
sparseCheckout = [ "client/python" ];
44-
hash = "sha256-u4GQYtCeAMDqRRbZGtjfqIHwuHyxUpw6kRE75SJMALg=";
45+
hash = "sha256-9hEls6f3aBNg7W2RGhu68mJSGlUScpNqMGsdHxTGyRY=";
4546
};
46-
prePatch = ''
47-
cd client/python
48-
'';
47+
48+
sourceRoot = "${src.name}/client/python";
4949

5050
# upstream adds upper constraints because they can, not because the need to
5151
# https://github.com/gradio-app/gradio/pull/4885
@@ -71,20 +71,20 @@ buildPythonPackage rec {
7171
];
7272

7373
nativeCheckInputs = [
74-
pytestCheckHook
75-
pytest-asyncio
74+
gradio.sans-reverse-dependencies
7675
pydub
76+
pytest-asyncio
77+
pytestCheckHook
7778
rich
78-
tomlkit
7979
safehttpx
80-
gradio.sans-reverse-dependencies
80+
tomlkit
81+
writableTmpDirAsHomeHook
8182
];
8283
# ensuring we don't propagate this intermediate build
8384
disallowedReferences = [ gradio.sans-reverse-dependencies ];
8485

8586
# Add a pytest hook skipping tests that access network, marking them as "Expected fail" (xfail).
8687
preCheck = ''
87-
export HOME=$TMPDIR
8888
cat ${./conftest-skip-network-errors.py} >> test/conftest.py
8989
'';
9090

pkgs/development/python-modules/gradio/default.nix

Lines changed: 46 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
lib,
33
stdenv,
44
buildPythonPackage,
5-
fetchPypi,
65
fetchFromGitHub,
7-
fetchpatch,
8-
pythonOlder,
96
writeShellScriptBin,
107
gradio,
118

12-
# pyproject
9+
# build-system
1310
hatchling,
1411
hatch-requirements-txt,
1512
hatch-fancy-pypi-readme,
@@ -19,14 +16,15 @@
1916
nodejs,
2017
pnpm_9,
2118

22-
# runtime
19+
# dependencies
2320
setuptools,
2421
aiofiles,
2522
anyio,
2623
diffusers,
2724
fastapi,
2825
ffmpy,
2926
gradio-client,
27+
groovy,
3028
httpx,
3129
huggingface-hub,
3230
importlib-resources,
@@ -53,7 +51,7 @@
5351
authlib,
5452
itsdangerous,
5553

56-
# check
54+
# tests
5755
pytestCheckHook,
5856
hypothesis,
5957
altair,
@@ -68,42 +66,32 @@
6866
tqdm,
6967
transformers,
7068
vega-datasets,
69+
writableTmpDirAsHomeHook,
7170
}:
7271

7372
buildPythonPackage rec {
7473
pname = "gradio";
75-
version = "5.11.0";
74+
version = "5.20.0";
7675
pyproject = true;
7776

78-
disabled = pythonOlder "3.7";
79-
80-
# unfortunately no fetchPypi due to https://github.com/gradio-app/gradio/pull/9778
8177
src = fetchFromGitHub {
8278
owner = "gradio-app";
8379
repo = "gradio";
8480
tag = "gradio@${version}";
85-
hash = "sha256-HW0J7oSkCo4DIHpU4LUoBZ2jmmrv5Xd64floA4uyo5A=";
81+
hash = "sha256-gAAyhsnc1LUcAvlUC5hftsWN1kSiRWqcQ4iKGpSIL+U=";
8682
};
8783

8884
pnpmDeps = pnpm_9.fetchDeps {
8985
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+
};
9788

9889
pythonRelaxDeps = [
99-
"tomlkit"
10090
"aiofiles"
10191
"markupsafe"
102-
"pillow"
10392
];
10493

10594
pythonRemoveDeps = [
106-
# our package is presented as a binary, not a python lib - and
10795
# this isn't a real runtime dependency
10896
"ruff"
10997
];
@@ -128,6 +116,7 @@ buildPythonPackage rec {
128116
fastapi
129117
ffmpy
130118
gradio-client
119+
groovy
131120
httpx
132121
huggingface-hub
133122
importlib-resources
@@ -156,26 +145,30 @@ buildPythonPackage rec {
156145
itsdangerous
157146
];
158147

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
175-
176-
# mock calls to `shutil.which(...)`
177-
(writeShellScriptBin "npm" "false")
178-
] ++ optional-dependencies.oauth ++ pydantic.optional-dependencies.email;
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
165+
166+
# mock calls to `shutil.which(...)`
167+
(writeShellScriptBin "npm" "false")
168+
writableTmpDirAsHomeHook
169+
]
170+
++ optional-dependencies.oauth
171+
++ pydantic.optional-dependencies.email;
179172

180173
preBuild = ''
181174
pnpm build
@@ -191,11 +184,10 @@ buildPythonPackage rec {
191184
# We additionally xfail FileNotFoundError, since the gradio devs often fail to upload test assets to pypi.
192185
preCheck =
193186
''
194-
export HOME=$TMPDIR
195187
cat ${./conftest-skip-network-errors.py} >> test/conftest.py
196188
''
189+
# OSError: [Errno 24] Too many open files
197190
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
198-
# OSError: [Errno 24] Too many open files
199191
ulimit -n 4096
200192
'';
201193

@@ -250,6 +242,16 @@ buildPythonPackage rec {
250242
"test_get_executable_path"
251243
]
252244
++ 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+
253255
# flaky on darwin (depend on port availability)
254256
"test_all_status_messages"
255257
"test_async_generators"
@@ -316,8 +318,7 @@ buildPythonPackage rec {
316318
];
317319

318320
# check the binary works outside the build env
319-
doInstallCheck = true;
320-
postInstallCheck = ''
321+
postCheck = ''
321322
env --ignore-environment $out/bin/gradio environment >/dev/null
322323
'';
323324

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
}

pkgs/top-level/python-packages.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5724,6 +5724,8 @@ self: super: with self; {
57245724

57255725
groestlcoin-hash = callPackage ../development/python-modules/groestlcoin-hash { };
57265726

5727+
groovy = callPackage ../development/python-modules/groovy { };
5728+
57275729
grpc-google-iam-v1 = callPackage ../development/python-modules/grpc-google-iam-v1 { };
57285730

57295731
grpc-interceptor = callPackage ../development/python-modules/grpc-interceptor { };

0 commit comments

Comments
 (0)