Package Details: python-gradio 5.34.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: 3
Popularity: 0.156281
First Submitted: 2022-10-21 14:20 (UTC)
Last Updated: 2025-06-20 08:06 (UTC)

Latest Comments

1 2 3 4 Next › Last »

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.

vcalv commented on 2025-06-21 05:26 (UTC) (edited on 2025-06-21 05:43 (UTC) by vcalv)

First of all, thank you for your work as responsiveness.

I understand now, but isn't there a way to generate those stub files on build?

I assume you mean files file *.pyi.

I'm sure something like running that on build and then installing it can be done.

Am I wrong here?

medaminezghal commented on 2025-06-21 05:01 (UTC)

@vcalv To install Gradio successfully, I need to import it once in python with root privilege to generate the necessary stubs files that are needed to run gradio command from terminal. That's why I use post_install to make sure that stubs files are generated and post_remove to remove them.

I don't know about any issue related to low memory issue because I have 32GB RAM in my computer so I never get any build issue for the javascript build.

If there is any test that fails please report it in comments to check it because when I install it I didn't get any failed tests.

vcalv commented on 2025-06-21 00:29 (UTC) (edited on 2025-06-21 03:18 (UTC) by vcalv)

Maybe I'm being pedantic, but does this package really need a python-gradio.install file that explicitly deletes a bunch of folders on uninstall?

Why do more files than the ones installed need to be removed? Because that is the only reason to do something like this.

What exactly is happening here?

This should not be needed and is a bit dangerous since it will be run as root and in principle completely unnecessary.

The only way this could even make sense is if the package wrote something when run in those directories and if that happens then there are more serious problems.

vcalv commented on 2025-06-20 23:14 (UTC) (edited on 2025-06-20 23:14 (UTC) by vcalv)

I built it on a clean chroot. That can't be the issue.

The build process just needs more memory than the soft default.

It's not like my laptop is low either, I just need to increase it via the environment variable option.

These javascript builds are just ridiculous...

Then I got one test error but quite frankly I just ignored it.

medaminezghal commented on 2025-06-20 07:37 (UTC)

@vcalv try delete the cache folder