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

replacing distutils.StrictVersion dependency for Python 3.12 #6938

Merged
merged 4 commits into from Jan 3, 2024
Merged

replacing distutils.StrictVersion dependency for Python 3.12 #6938

merged 4 commits into from Jan 3, 2024

Conversation

velaia
Copy link
Contributor

@velaia velaia commented Jan 3, 2024

…ersion after distutils deprecation (in 3.10) and removal in Python 3.12 (see https://docs.python.org/3.10/whatsnew/3.10.html#distutils-deprecated)

Description

gradio had an error on startup on Python 3.12.1:

(.venv) daniel@Daniels-MacBook-Pro gradio_dev % python main.py
Traceback (most recent call last):
  File "/Users/daniel/git/gradio_dev/main.py", line 1, in <module>
    import gradio as gr
  File "/Users/daniel/git/gradio_dev/.venv/lib/python3.12/site-packages/gradio/__init__.py", line 3, in <module>
    import gradio._simple_templates
  File "/Users/daniel/git/gradio_dev/.venv/lib/python3.12/site-packages/gradio/_simple_templates/__init__.py", line 1, in <module>
    from .simpledropdown import SimpleDropdown
  File "/Users/daniel/git/gradio_dev/.venv/lib/python3.12/site-packages/gradio/_simple_templates/simpledropdown.py", line 6, in <module>
    from gradio.components.base import FormComponent
  File "/Users/daniel/git/gradio_dev/.venv/lib/python3.12/site-packages/gradio/components/__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "/Users/daniel/git/gradio_dev/.venv/lib/python3.12/site-packages/gradio/components/annotated_image.py", line 12, in <module>
    from gradio.components.base import Component
  File "/Users/daniel/git/gradio_dev/.venv/lib/python3.12/site-packages/gradio/components/base.py", line 21, in <module>
    from gradio.blocks import Block, BlockContext
  File "/Users/daniel/git/gradio_dev/.venv/lib/python3.12/site-packages/gradio/blocks.py", line 29, in <module>
    from gradio import (
  File "/Users/daniel/git/gradio_dev/.venv/lib/python3.12/site-packages/gradio/analytics.py", line 10, in <module>
    from distutils.version import StrictVersion
ModuleNotFoundError: No module named 'distutils'
(.venv) daniel@Daniels-MacBook-Pro gradio_dev % python --version
Python 3.12.1

Closes: #6937

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Tests

I couldn't run the full test suite locally due to complications with bash scripts/build_frontend.sh (on macOS). I tested by adjusting the file and running the demo app with Python 3.12.1

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Jan 3, 2024

🪼 branch checks and previews

Name Status URL
Storybook ready! Storybook preview
Visual tests all good! Build review
🦄 Changes detected! Details

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Jan 3, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

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

With the following changelog entry.

replacing distutils.StrictVersion dependency for Python 3.12

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.

@abidlabs
Copy link
Member

abidlabs commented Jan 3, 2024

Thanks so much @velaia! LGTM

@abidlabs abidlabs merged commit 459c5dc into gradio-app:main Jan 3, 2024
8 of 15 checks passed
@pngwn pngwn mentioned this pull request Jan 3, 2024
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.

Python 3.12 compatibility
3 participants