push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,127 @@
{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
nix-update-script,
# build-system
hatchling,
hatch-requirements-txt,
hatch-fancy-pypi-readme,
# dependencies
fsspec,
httpx,
huggingface-hub,
packaging,
typing-extensions,
websockets,
# tests
gradio,
pydub,
pytest-asyncio,
pytestCheckHook,
rich,
safehttpx,
tomlkit,
writableTmpDirAsHomeHook,
}:
buildPythonPackage rec {
pname = "gradio-client";
version = "1.11.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@${version}";
sparseCheckout = [ "client/python" ];
hash = "sha256-dj8hJPXUBbFG9awP3o0vgyPt+gcCgzKKEQTEHkrEimA=";
};
sourceRoot = "${src.name}/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"
];
build-system = [
hatchling
hatch-requirements-txt
hatch-fancy-pypi-readme
];
dependencies = [
fsspec
httpx
huggingface-hub
packaging
typing-extensions
websockets
];
nativeCheckInputs = [
gradio.sans-reverse-dependencies
pydub
pytest-asyncio
pytestCheckHook
rich
safehttpx
tomlkit
writableTmpDirAsHomeHook
];
# ensuring we don't propagate this intermediate build
disallowedReferences = [ gradio.sans-reverse-dependencies ];
# Add a pytest hook skipping tests that access network, marking them as "Expected fail" (xfail).
preCheck = ''
cat ${./conftest-skip-network-errors.py} >> test/conftest.py
'';
pytestFlags = [
#"-x" "-Wignore" # uncomment for debugging help
];
enabledTestPaths = [
"test/"
];
disabledTestMarks = [
"flaky"
];
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [
# flaky: OSError: Cannot find empty port in range: 7860-7959
"test_layout_components_in_output"
"test_layout_and_state_components_in_output"
"test_upstream_exceptions"
"test_httpx_kwargs"
];
pythonImportsCheck = [ "gradio_client" ];
__darwinAllowLocalNetworking = true;
passthru.updateScript = nix-update-script {
extraArgs = [
"--version-regex"
"gradio_client@(.*)"
];
};
meta = {
homepage = "https://www.gradio.app/";
changelog = "https://github.com/gradio-app/gradio/releases/tag/gradio_client@${version}";
description = "Lightweight library to use any Gradio app as an API";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ pbsds ];
};
}