9 , hatch-requirements-txt
10 , hatch-fancy-pypi-readme
54 buildPythonPackage rec {
59 disabled = pythonOlder "3.7";
61 # We use the Pypi release, as it provides prebuilt webui assets,
62 # and has more frequent releases compared to github tags
64 inherit pname version;
65 hash = "sha256-3mXs9PwlzUo89VosBWtnsOzDQf/T22Yv7s5j6OLLp3M=";
68 # fix packaging.ParserSyntaxError, which can't handle comments
70 sed -ie "s/ #.*$//g" requirements*.txt
76 hatch-requirements-txt
77 hatch-fancy-pypi-readme
80 propagatedBuildInputs = [
81 setuptools # needed for 'pkg_resources'
109 nativeCheckInputs = [
117 # shap is needed as well, but breaks too often
124 # Add a pytest hook skipping tests that access network, marking them as "Expected fail" (xfail).
125 # We additionally xfail FileNotFoundError, since the gradio devs often fail to upload test assets to pypi.
128 cat ${./conftest-skip-network-errors.py} >> test/conftest.py
133 "test_mount_gradio_app"
135 # requires network, it caught our xfail exception
136 "test_error_analytics_successful"
138 # Flaky, tries to pin dependency behaviour. Sensitive to dep versions
139 # These error only affect downstream use of the check dependencies.
141 "test_in_interface_as_output"
142 "test_should_warn_url_not_having_version"
144 # Flaky, unknown reason
147 # shap is too often broken in nixpkgs
150 disabledTestPaths = [
151 # makes pytest freeze 50% of the time
152 "test/test_interfaces.py"
155 "-x" # abort on first failure
156 #"-m" "not flaky" # doesn't work, even when advertised
157 #"-W" "ignore" # uncomment for debugging help
160 # check the binary works outside the build env
161 doInstallCheck = true;
162 postInstallCheck = ''
163 env --ignore-environment $out/bin/gradio environment >/dev/null
166 pythonImportsCheck = [ "gradio" ];
169 homepage = "https://www.gradio.app/";
170 description = "Python library for easily interacting with trained machine learning models";
171 license = licenses.asl20;
172 maintainers = with maintainers; [ pbsds ];