Package Details: python-gradio 6.0.2-1

Git Clone URL: https://aur.archlinux.org/python-gradio.git (read-only, click to copy)
Package Base: python-gradio
Description: Python library for easily interacting with trained machine learning models.
Upstream URL: https://github.com/gradio-app/gradio
Keywords: python-gradio
Licenses: Apache-2.0
Submitter: huyz
Maintainer: medaminezghal
Last Packager: medaminezghal
Votes: 4
Popularity: 0.012301
First Submitted: 2022-10-21 14:20 (UTC)
Last Updated: 2025-12-03 09:46 (UTC)

Latest Comments

1 2 3 4 Next › Last »

snigurmd commented on 2025-12-29 08:54 (UTC) (edited on 2025-12-29 09:51 (UTC) by snigurmd)

Python-gradio and python-gradio-client have circular dependency. Unable to install from scratch.

Maziar commented on 2025-12-27 16:17 (UTC)

can use it instead use pnpm & current seems work

# Maintainer: Mohamed Amine Zghal (medaminezghal) <medaminezghal at outlook dot com>

_name=gradio
pkgname=python-$_name
pkgver=6.0.2
pkgrel=1
pkgdesc='Python library for easily interacting with trained machine learning models.'
arch=('any')
url='https://github.com/gradio-app/gradio'
license=('Apache-2.0')
depends=('python' 'python-aiofiles' 'python-anyio' 'python-brotli' 'python-fastapi' 'python-ffmpy' 'python-groovy' 'python-gradio-client' 'python-httpx' 'python-huggingface-hub' 'python-jinja' 'python-markupsafe' 'python-numpy' 'python-orjson' 'python-packaging' 'python-pandas' 'python-pillow' 'python-pydantic' 'python-python-multipart' 'python-pydub' 'python-pyyaml' 'python-safehttpx' 'python-semantic-version' 'python-starlette' 'python-tomlkit' 'python-typer' 'python-typing_extensions' 'uvicorn')
makedepends=('python-hatchling' 'python-hatch-requirements-txt' 'python-hatch-fancy-pypi-readme' 'python-build' 'python-installer' 'python-wheel' 'pnpm')
checkdepends=('ipython' 'python-altair' 'python-boto3' 'python-gradio-pdf' 'python-matplotlib' 'python-hypothesis' 'jupyter-nbformat' 'python-openai' 'python-polars' 'python-email-validator' 'python-pytest' 'python-pytest-asyncio' 'python-pytest-rerunfailures' 'python-respx' 'python-scikit-image' 'python-pytorch' 'python-tqdm' 'python-transformers' 'python-vega_datasets' 'python-diffusers' 'python-mcp' 'python-tf-keras' 'python-itsdangerous')
optdepends=('python-authlib: oauth' 'python-itsdangerous: oauth' 'python-mcp: mcp' 'python-pydantic: mcp' 'ruff: needed for custom component docs generation')
source=("$url/archive/refs/tags/$_name@$pkgver.tar.gz")
sha256sums=('2162b735193be26637ecb4aa830fc73cabc0f8b92822a260a1a10b18752d2620')

prepare(){
  cd "$srcdir"/$_name-$_name-$pkgver
  rm -rf test/test_docker # Remove tests that need docker
}

build() {
  cd "$srcdir"/$_name-$_name-$pkgver
  export PNPM_HOME="$srcdir/pnpm"
  export PATH="$PNPM_HOME:$PATH"
  pnpm config set store-dir "$srcdir/pnpm-store"
  pnpm i --frozen-lockfile --ignore-scripts
  NODE_OPTIONS="--max-old-space-size=8192" pnpm build
  PYTHONPATH=$PWD python -c "import gradio"
  python -m build --wheel --no-isolation
}

check() {
  local pytest_options=(
    -vv
    --disable-warnings
    # Need HuggingFace token
    --deselect test/test_buttons.py::TestOAuthButtons::test_login_button_warns_when_not_on_spaces
    --deselect test/test_external.py
    # Need to be fixed by developers
    --deselect test/test_pipelines.py
  )
  cd "$srcdir"/$_name-$_name-$pkgver
  ulimit -n 16384
  PYTHONPATH=$PWD:$PWD/client/python pytest "${pytest_options[@]}" test
}

package() {
  cd "$srcdir"/$_name-$_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
}

vcalv commented on 2025-06-28 19:07 (UTC)

Much better but I believe the function you should be using is also pre_upgrade and not only post_remove.

But it's all good, the upgrade will fail.

The conflicting files will the part of the output and the user just has to delete them manually.

Next version upgrade you can just delete the entire install script.

Thank you for your work.

medaminezghal commented on 2025-06-28 08:32 (UTC)

@vcalv What about the changes in new version?

medaminezghal commented on 2025-06-22 10:44 (UTC)

@vcalv I toltally agree.

I will do what you suggest and I'm gonnat let the post-delete delete the hash_seed.txt file.

vcalv commented on 2025-06-21 19:49 (UTC)

I'm sorry but polluting the filesystem with a bunch of files generated at install time where python is essentially run as root is not OK, especially when such files can be created at build time.

In fact, these files are not even necessary, they are a nice to have!

I can't stress this enough, this is a serious breach of trust even if there is obviously no malicious intent.

If it fails for other people then it's up to them to suggest changes that don't involve this.

I believe you are talking about @Pulec and @Ragnor.

They are wrong!

You can make use of this module at build time by running:

export PYTHONPATH="${srcdir}/${_name}-${_name}-${pkgver}:$PYTHONPATH"

in the build section (or other) before you use python.

The import gradio will work regardless because python searches the CWD by default.

The themes (I have no idea what's happening there) will need this, but it's not being run now anyway!

There is nothing really wrong with this.

There is however something very wrong with how things are currently done.

I just tested with a clean chroot build and it worked, took forever, but it worked.

SO please, change the PKGBUILD to not import the module at post install.

medaminezghal commented on 2025-06-21 16:32 (UTC)

@vclav I've done this for previous versiosn and it works for me but for some reason it didn't for other peoples. You can check it in previous comments. That's why I use the post-install to fix it.

vcalv commented on 2025-06-21 15:35 (UTC) (edited on 2025-06-21 15:42 (UTC) by vcalv)

I solved the generation of the *.pyi files on build and it wasn't even very difficult or strange

Right before the python build line:

python -m build --wheel --no-isolation

You have to run:

python -c "import gradio"

It has to be before.

That's it. It works.

After that there are 2 problems:

  • There's a bunch in files in the filesystem that don't belong to any packages because you created them at install time and are now going to be overwritten by this package. You have to modify the install script and add a pre_upgrade function where you delete them, just like you currently do in post_remove

  • One file is not currently generated at build, it's /usr/lib/python3.13/site-packages/gradio/hash_seed.txt and I have no idea what to do about this.

After a while you can just remove the install script entirely.

You could remove it immediately but then users would need to do some manual intervention.

Please, consider going down this road.

medaminezghal commented on 2025-06-21 06:07 (UTC)

@vcalv I've searched for solution but I found that those files are created only when you import gradio.