Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added audioop-lts module to support pydub for python3.13+ #9757

Merged
merged 6 commits into from
Oct 22, 2024

Conversation

samy-FERGUI
Copy link
Contributor

@samy-FERGUI samy-FERGUI commented Oct 18, 2024

Description

While testing the Gradio library locally, I encountered an issue where the audioop module has been removed in Python 3.13+, causing import errors within the pydub library. To address this, I added the audioop-lts module to provide support and resolve the issue.

Closes: #9696

🎯 PRs Should Target Issues

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 18, 2024

🪼 branch checks and previews

Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
🦄 Changes detected! Details

Install Gradio from this PR

pip install https://gradio-pypi-previews.s3.amazonaws.com/994c3ce18a2f4795c0a6878d7418faad1611a58d/gradio-5.3.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@994c3ce18a2f4795c0a6878d7418faad1611a58d#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/994c3ce18a2f4795c0a6878d7418faad1611a58d/gradio-client-1.7.0.tgz

Use Lite from this PR

<script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/994c3ce18a2f4795c0a6878d7418faad1611a58d/dist/lite.js""></script>

@gradio-pr-bot
Copy link
Collaborator

gradio-pr-bot commented Oct 18, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio patch
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

added audioop-lts module to support pydub for python3.13+

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@samy-FERGUI samy-FERGUI marked this pull request as ready for review October 19, 2024 09:12
@abidlabs
Copy link
Member

Thanks @samy-FERGUI! It looks like we can revert your earlier changes in the docs about restricting Gradio to Python 3.12 and below, as part of this PR?

@samy-FERGUI
Copy link
Contributor Author

@abidlabs indeed, we can revert the first commit now since we've solved the issue

@abidlabs
Copy link
Member

Could you do that as part of this PR please? Thanks!

@samy-FERGUI
Copy link
Contributor Author

@abidlabs done

@@ -30,7 +30,7 @@ The Gradio client works with any hosted Gradio app! Although the Client is mostl

If you already have a recent version of `gradio`, then the `gradio_client` is included as a dependency. But note that this documentation reflects the latest version of the `gradio_client`, so upgrade if you're not sure!

The lightweight `gradio_client` package can be installed from pip (or pip3) and is tested to work with [**Python 3.10 - 3.12**]:
The lightweight `gradio_client` package can be installed from pip (or pip3) and is tested to work with **Python versions 3.9 or higher**:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.10 or higher

requirements.txt Outdated
@@ -24,3 +24,4 @@ uvicorn>=0.14.0; sys.platform != 'emscripten'
typer>=0.12,<1.0; sys.platform != 'emscripten'
tomlkit==0.12.0
ruff>=0.2.2; sys.platform != 'emscripten'
audioop-lts; python_version >= "3.13" #it provides support for 'audioop' module removed in latest python version used by pydub
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file seems to be in alphabetical order

Copy link
Collaborator

@aliabid94 aliabid94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful, thanks so much @samy-FERGUI !

@samy-FERGUI
Copy link
Contributor Author

@aliabid94 @abidlabs it was a pleasure to help !

@abidlabs
Copy link
Member

CI looks good, merging!

@abidlabs abidlabs merged commit f971ca6 into gradio-app:main Oct 22, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incompatibility with Python 3.13.0 while using gradio library
4 participants