Commit f7f0434d authored by Gaetan Lepage's avatar Gaetan Lepage
Browse files
parent bc0e5c9d
Loading
Loading
Loading
Loading
+20 −20
Original line number Diff line number Diff line
@@ -4,12 +4,13 @@
  buildPythonPackage,
  fetchFromGitHub,
  nix-update-script,
  pythonOlder,
  # pyproject

  # build-system
  hatchling,
  hatch-requirements-txt,
  hatch-fancy-pypi-readme,
  # runtime

  # dependencies
  setuptools,
  fsspec,
  httpx,
@@ -17,23 +18,23 @@
  packaging,
  typing-extensions,
  websockets,
  # checkInputs
  pytestCheckHook,
  pytest-asyncio,

  # tests
  gradio,
  pydub,
  pytest-asyncio,
  pytestCheckHook,
  rich,
  tomlkit,
  gradio,
  safehttpx,
  tomlkit,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage rec {
  pname = "gradio-client";
  version = "1.5.3";
  version = "1.7.2";
  pyproject = true;

  disabled = pythonOlder "3.8";

  # no tests on pypi
  src = fetchFromGitHub {
    owner = "gradio-app";
@@ -41,11 +42,10 @@ buildPythonPackage rec {
    # not to be confused with @gradio/client@${version}
    tag = "gradio_client@${version}";
    sparseCheckout = [ "client/python" ];
    hash = "sha256-u4GQYtCeAMDqRRbZGtjfqIHwuHyxUpw6kRE75SJMALg=";
    hash = "sha256-9hEls6f3aBNg7W2RGhu68mJSGlUScpNqMGsdHxTGyRY=";
  };
  prePatch = ''
    cd client/python
  '';

  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
@@ -71,20 +71,20 @@ buildPythonPackage rec {
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-asyncio
    gradio.sans-reverse-dependencies
    pydub
    pytest-asyncio
    pytestCheckHook
    rich
    tomlkit
    safehttpx
    gradio.sans-reverse-dependencies
    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 = ''
    export HOME=$TMPDIR
    cat ${./conftest-skip-network-errors.py} >> test/conftest.py
  '';