From ef8b97223d1695c76a16a597b7363bb9dd3c8537 Mon Sep 17 00:00:00 2001 From: Abubakar Abid Date: Tue, 19 Apr 2022 11:27:32 -0700 Subject: [PATCH] Fixing import issues so that the package successfully installs on colab notebooks (#1027) * updated PyPi version to 2.9.0b * added to init * moved media_data * formatting * updated PyPi version to 2.9.0b2 --- gradio.egg-info/PKG-INFO | 2 +- gradio/components.py | 3 +-- gradio/{test_data => }/media_data.py | 0 gradio/test_data/__init__.py | 1 + gradio/version.txt | 2 +- setup.py | 2 +- test/test_components.py | 2 +- test/test_encryptor.py | 2 +- test/test_inputs.py | 2 +- test/test_interpretation.py | 3 +-- test/test_outputs.py | 2 +- test/test_processing_utils.py | 2 +- 12 files changed, 11 insertions(+), 12 deletions(-) rename gradio/{test_data => }/media_data.py (100%) diff --git a/gradio.egg-info/PKG-INFO b/gradio.egg-info/PKG-INFO index 96e461ed6b..7a9ecc4e6b 100644 --- a/gradio.egg-info/PKG-INFO +++ b/gradio.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: gradio -Version: 2.9.0b0 +Version: 2.9.0b2 Summary: Python library for easily interacting with trained machine learning models Home-page: https://github.com/gradio-app/gradio-UI Author: Abubakar Abid, Ali Abid, Ali Abdalla, Dawood Khan, Ahsen Khaliq, Pete Allen, Ömer Faruk Özdemir diff --git a/gradio/components.py b/gradio/components.py index cf33738a59..bd571e0f06 100644 --- a/gradio/components.py +++ b/gradio/components.py @@ -20,9 +20,8 @@ import PIL from ffmpy import FFmpeg from markdown_it import MarkdownIt -from gradio import processing_utils +from gradio import media_data, processing_utils from gradio.blocks import Block -from gradio.test_data import media_data class Component(Block): diff --git a/gradio/test_data/media_data.py b/gradio/media_data.py similarity index 100% rename from gradio/test_data/media_data.py rename to gradio/media_data.py diff --git a/gradio/test_data/__init__.py b/gradio/test_data/__init__.py index e69de29bb2..407d4b5a78 100644 --- a/gradio/test_data/__init__.py +++ b/gradio/test_data/__init__.py @@ -0,0 +1 @@ +import gradio.media_data as media_data diff --git a/gradio/version.txt b/gradio/version.txt index e9749a23a6..9cc23e0a46 100644 --- a/gradio/version.txt +++ b/gradio/version.txt @@ -1 +1 @@ -2.9.0b \ No newline at end of file +2.9.0b2 \ No newline at end of file diff --git a/setup.py b/setup.py index ab9c93f6a3..6e2eea21b4 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ except ImportError: setup( name="gradio", - version="2.9.0b", + version="2.9.0b2", include_package_data=True, description="Python library for easily interacting with trained machine learning models", author="Abubakar Abid, Ali Abid, Ali Abdalla, Dawood Khan, Ahsen Khaliq, Pete Allen, Ömer Faruk Özdemir", diff --git a/test/test_components.py b/test/test_components.py index 9d42647548..ab04a0dc1a 100644 --- a/test/test_components.py +++ b/test/test_components.py @@ -11,7 +11,7 @@ import pandas as pd import PIL import gradio as gr -from gradio.test_data import media_data +from gradio import media_data os.environ["GRADIO_ANALYTICS_ENABLED"] = "False" diff --git a/test/test_encryptor.py b/test/test_encryptor.py index d3b06050a5..923dfc4e74 100644 --- a/test/test_encryptor.py +++ b/test/test_encryptor.py @@ -2,7 +2,7 @@ import os import unittest from gradio import encryptor, processing_utils -from gradio.test_data.media_data import BASE64_IMAGE +from gradio.media_data import BASE64_IMAGE os.environ["GRADIO_ANALYTICS_ENABLED"] = "False" diff --git a/test/test_inputs.py b/test/test_inputs.py index 10e26f66ce..e2b39c2e7d 100644 --- a/test/test_inputs.py +++ b/test/test_inputs.py @@ -10,7 +10,7 @@ import pandas import PIL import gradio as gr -from gradio.test_data import media_data +from gradio import media_data os.environ["GRADIO_ANALYTICS_ENABLED"] = "False" diff --git a/test/test_interpretation.py b/test/test_interpretation.py index a5db374f91..51860cc50f 100644 --- a/test/test_interpretation.py +++ b/test/test_interpretation.py @@ -5,9 +5,8 @@ from copy import deepcopy import numpy as np import gradio.interpretation -from gradio import Interface +from gradio import Interface, media_data from gradio.processing_utils import decode_base64_to_image -from gradio.test_data import media_data os.environ["GRADIO_ANALYTICS_ENABLED"] = "False" diff --git a/test/test_outputs.py b/test/test_outputs.py index c90d01ce82..3528a43e97 100644 --- a/test/test_outputs.py +++ b/test/test_outputs.py @@ -8,7 +8,7 @@ import numpy as np import pandas as pd import gradio as gr -from gradio.test_data import media_data +from gradio import media_data os.environ["GRADIO_ANALYTICS_ENABLED"] = "False" diff --git a/test/test_processing_utils.py b/test/test_processing_utils.py index 283f0d5770..0904591cde 100644 --- a/test/test_processing_utils.py +++ b/test/test_processing_utils.py @@ -8,7 +8,7 @@ import numpy as np from PIL import Image import gradio as gr -from gradio.test_data import media_data +from gradio import media_data os.environ["GRADIO_ANALYTICS_ENABLED"] = "False"