adding gradio dependencies

This commit is contained in:
Rolf Verschuuren 2022-10-21 14:00:33 +02:00 committed by gbtb
parent 8f8ab76322
commit c2d81d517c
6 changed files with 289 additions and 18 deletions

View File

@ -30,6 +30,9 @@
lpips
fastapi
lark
analytics-python
ffmpy
markdown-it-py
gradio
albumentations
@ -100,6 +103,9 @@
filterpy = callPackage ./packages/filterpy { };
kornia = callPackage ./packages/kornia { };
lpips = callPackage ./packages/lpips { };
ffmpy = callPackage ./packages/ffmpy { };
analytics-python = callPackage ./packages/analytics-python { };
markdown-it-py = callPackage ./packages/markdown-it-py { };
gradio = callPackage ./packages/gradio { };
torch-fidelity = callPackage ./packages/torch-fidelity { };
resize-right = callPackage ./packages/resize-right { };

View File

@ -0,0 +1,52 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, requests
, monotonic
, backoff
, python-dateutil
}:
buildPythonPackage rec {
pname = "analytics-python";
version = "1.4.0";
disabled = pythonOlder "3.6";
src = fetchPypi {
inherit pname version;
sha256 = "plFBq25H2zlvW8Vwix25P/mpmILYH+gIIor9Xrtt/l8=";
};
postPatch = ''
substituteInPlace setup.py \
--replace '"backoff==1.10.0"' '"backoff>=1.10.0,<3"'
'';
propagatedBuildInputs = [
monotonic
requests
backoff
python-dateutil
];
# Almost all tests run against a hosted API, and the few that are mocked are hard to cherry-pick
doCheck = false;
pythonImportsCheck = [
"analytics"
"analytics.client"
"analytics.consumer"
"analytics.request"
"analytics.utils"
"analytics.version"
];
meta = with lib; {
homepage = "https://segment.com/libraries/python";
description = "Hassle-free way to integrate analytics into any python application";
license = licenses.mit;
maintainers = with maintainers; [ pbsds ];
};
}

View File

@ -0,0 +1,34 @@
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, ffmpeg
}:
buildPythonPackage rec {
pname = "ffmpy";
version = "0.3.0";
disabled = pythonOlder "3.6";
# The github repo has no release tags, the pypi distribution has no tests.
# This package is quite trivial anyway, and the tests mainly play around with the ffmpeg cli interface.
# https://github.com/Ch00k/ffmpy/issues/60
src = fetchPypi {
inherit pname version;
sha256 = "dXWRWB7uJbSlCsn/ubWANaJ5RTPbR+BRL1P7LXtvmtw=";
};
propagatedBuildInputs = [
ffmpeg
];
pythonImportsCheck = [ "ffmpy" ];
meta = with lib; {
description = "A simple python interface for FFmpeg/FFprobe";
homepage = "https://github.com/Ch00k/ffmpy";
license = licenses.mit;
maintainers = with maintainers; [ pbsds ];
};
}

View File

@ -1,26 +1,139 @@
# WARNING: This file was automatically generated. You should avoid editing it.
# If you run pynixify again, the file will be either overwritten or
# deleted, and you will lose the changes you made to it.
{ buildPythonPackage, fetchPypi, lib }:
{ lib
, buildPythonPackage
, fetchPypi
, pythonOlder
, writeTextFile
, setuptools
, analytics-python
, aiohttp
, fastapi
, ffmpy
, markdown-it-py
, linkify-it-py
, mdit-py-plugins
, matplotlib
, numpy
, orjson
, pandas
, paramiko
, pillow
, pycryptodome
, python-multipart
, pydub
, requests
, uvicorn
, jinja2
, fsspec
, httpx
, pydantic
, typing-extensions
, pytest-asyncio
, mlflow
, huggingface-hub
, transformers
, wandb
, respx
, scikitimage
, shap
, ipython
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "gradio";
version = "3.6";
version = "3.1.4";
disabled = pythonOlder "3.7";
# We use the Pypi release, as it provides prebuild webui assets,
# and its releases are also more frequent than github tags
src = fetchPypi {
inherit pname version;
sha256 = "123123123132";
sha256 = "5pzOfHDEBdz+HNGoaPwimBKixAZ1K6zD1a0IWLfzfxo=";
};
propagatedBuildInputs =
[ ];
propagatedBuildInputs = [
analytics-python
aiohttp
fastapi
ffmpy
matplotlib
numpy
orjson
pandas
paramiko
pillow
pycryptodome
python-multipart
pydub
requests
uvicorn
jinja2
fsspec
httpx
pydantic
markdown-it-py
] ++ markdown-it-py.optional-dependencies.plugins
++ markdown-it-py.optional-dependencies.linkify;
# TODO FIXME
doCheck = false;
postPatch = ''
# Unpin h11, as its version was only pinned to aid dependency resolution.
# Basically a revert of https://github.com/gradio-app/gradio/pull/1680
substituteInPlace requirements.txt \
--replace "h11<0.13,>=0.11" ""
'';
checkInputs = [
pytestCheckHook
pytest-asyncio
mlflow
#cometml # FIXME: enable once comet-ml is packaged
huggingface-hub
transformers
wandb
respx
scikitimage
shap
ipython
];
disabledTestPaths = [
# requires network connection
"test/test_tunneling.py"
"test/test_external.py"
];
disabledTests = [
# requires network connection
"test_encode_url_to_base64"
"test_launch_colab_share"
"test_with_external"
"test_setup_tunnel"
"test_url_ok"
"test_get"
"test_post"
"test_validate_with_model"
"test_validate_with_function"
# FIXME: enable once comet-ml is packaged
"test_inline_display"
"test_integration_comet"
# Expects a dep to generate a warning. Very sensitive to dep versions
"test_should_warn_url_not_having_version"
# FileNotFoundError, most likely flaky tests
"test_create_tmp_copy_of_file" # 'test.txt' missing
"test_as_component_as_output" # when moving files in /tmp
"test_component_functions" # when moving files in /tmp
];
#pytestFlagsArray = [ "-x" "-W" "ignore" ]; # debugging help
pythonImportsCheck = [ "gradio" ];
meta = with lib; {
description = "Build Machine Learning Web Apps";
homepage = "https://gradio.app/";
homepage = "https://www.gradio.app/";
description = "Python library for easily interacting with trained machine learning models";
license = licenses.asl20;
maintainers = with maintainers; [ pbsds ];
};
}
}

View File

@ -1,7 +1,3 @@
# WARNING: This file was automatically generated. You should avoid editing it.
# If you run pynixify again, the file will be either overwritten or
# deleted, and you will lose the changes you made to it.
{ buildPythonPackage, fetchPypi, lib, numpy, tqdm, scipy, torch
, torchvision }:

View File

@ -0,0 +1,70 @@
{ lib
, attrs
, buildPythonPackage
, fetchFromGitHub
, linkify-it-py
, mdit-py-plugins
, mdurl
, psutil
, pytest-benchmark
, pytest-regressions
, pytestCheckHook
, pythonOlder
, typing-extensions
}:
buildPythonPackage rec {
pname = "markdown-it-py";
version = "2.1.0";
format = "flit";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "executablebooks";
repo = pname;
rev = "refs/tags/v${version}";
sha256 = "sha256-6UATJho3SuIbLktZtFcDrCTWIAh52E+n5adcgl49un0=";
};
postPatch = ''
# Allow linkify-it-py v2.
# This only affects projects that depend on 'markdown-it-py[linkify]'
# https://github.com/executablebooks/markdown-it-py/pull/218
substituteInPlace pyproject.toml \
--replace "linkify-it-py~=1.0" "linkify-it-py>=1,<3"
'';
propagatedBuildInputs = [
attrs
mdurl
] ++ lib.optional (pythonOlder "3.8") [
typing-extensions
];
passthru.optional-dependencies = {
linkify = [ linkify-it-py ];
plugins = [ mdit-py-plugins ];
};
checkInputs = [
linkify-it-py
psutil
pytest-benchmark
pytest-regressions
pytestCheckHook
];
pythonImportsCheck = [
"markdown_it"
];
meta = with lib; {
description = "Markdown parser in Python";
homepage = "https://markdown-it-py.readthedocs.io/";
changelog = "https://github.com/executablebooks/markdown-it-py/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ bhipple ];
};
}