Skip to content

Commit

Permalink
Merge branch 'main' into marked
Browse files Browse the repository at this point in the history
  • Loading branch information
dawoodkhan82 authored May 18, 2023
2 parents 8450c44 + 9ece3b4 commit 8242c06
Show file tree
Hide file tree
Showing 13 changed files with 7 additions and 21 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ No changes to highlight.

- Refactor web component `initial_height` attribute by [@whitphx](https://github.com/whitphx) in [PR 4223](https://github.com/gradio-app/gradio/pull/4223)
- Relocate `mount_css` fn to remove circular dependency [@whitphx](https://github.com/whitphx) in [PR 4222](https://github.com/gradio-app/gradio/pull/4222)
- Upgrade Black to 23.3 by [@akx](https://github.com/akx) in [PR 4259](https://github.com/gradio-app/gradio/pull/4259)

## Breaking Changes:

Expand Down
1 change: 0 additions & 1 deletion client/python/gradio_client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,6 @@ def __str__(self):
return self.__repr__()

def make_end_to_end_fn(self, helper: Communicator | None = None):

_predict = self.make_predict(helper)

def _inner(*data):
Expand Down
2 changes: 1 addition & 1 deletion client/python/test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
black==22.6.0
black==23.3.0
pytest-asyncio
pytest==7.1.2
ruff==0.0.264
Expand Down
1 change: 0 additions & 1 deletion client/python/test/test_serializing.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def test_all_components_in_component_mapping(all_components):


def test_file_serializing():

try:
serializing = FileSerializable()
with tempfile.NamedTemporaryFile(delete=False, mode="w") as f1:
Expand Down
1 change: 0 additions & 1 deletion gradio/external.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,6 @@ def from_spaces_interface(
iframe_url: str,
**kwargs,
) -> Interface:

config = streamline_spaces_interface(config)
api_url = f"{iframe_url}/api/predict/"
headers = {"Content-Type": "application/json"}
Expand Down
3 changes: 1 addition & 2 deletions gradio/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,6 @@ def attach_submit_events(self, submit_btn: Button | None, stop_btn: Button | Non
predict_events = []

if stop_btn:

# Wrap the original function to show/hide the "Stop" button
async def fn(*args):
# The main idea here is to call the original function
Expand Down Expand Up @@ -885,7 +884,7 @@ def __init__(
f"<h1 style='text-align: center; margin-bottom: 1rem'>{title}</h1>"
)
with Tabs():
for (interface, tab_name) in zip(interface_list, tab_names):
for interface, tab_name in zip(interface_list, tab_names):
with Tab(label=tab_name):
interface.render()

Expand Down
1 change: 0 additions & 1 deletion gradio/themes/utils/semver_match.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def get_theme_assets(space_info: huggingface_hub.hf_api.SpaceInfo) -> list[Theme
def get_matching_version(
assets: list[ThemeAsset], expression: str | None
) -> ThemeAsset | None:

expression = expression or "*"

# Return most recent version that matches
Expand Down
4 changes: 2 additions & 2 deletions test/requirements-37.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ attrs==21.4.0
# pytest
backcall==0.2.0
# via ipython
black==22.6.0
black==23.3.0
# via -r requirements.in
boto3==1.26.65
# via -r requirements.in
Expand Down Expand Up @@ -121,7 +121,7 @@ numpy==1.21.6
# shap
# tifffile
# transformers
packaging==21.3
packaging==22.0
# via
# huggingface-hub
# pytest
Expand Down
4 changes: 2 additions & 2 deletions test/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ attrs==21.4.0
# pytest
backcall==0.2.0
# via ipython
black==22.6.0
black==23.3.0
# via -r requirements.in
boto3==1.26.65
# via -r requirements.in
Expand Down Expand Up @@ -111,7 +111,7 @@ numpy==1.21.6
# shap
# tifffile
# transformers
packaging==21.3
packaging==22.0
# via
# huggingface-hub
# pytest
Expand Down
4 changes: 0 additions & 4 deletions test/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ async def _get_ws_pred(data, fn_index):
demo.close()

def test_socket_reuse(self):

try:
io = gr.Interface(lambda x: x, gr.Textbox(), gr.Textbox())
io.launch(server_port=9441, prevent_thread_lock=True)
Expand All @@ -375,7 +374,6 @@ def generator_function():
yield from range(10)

with gr.Blocks() as demo:

gr.Number(value=lambda: 2, every=2)
meaning_of_life = gr.Number()
counter = gr.Number()
Expand Down Expand Up @@ -524,7 +522,6 @@ def test_get_load_events(self, io_components):

class TestBlocksPostprocessing:
def test_blocks_do_not_filter_none_values_from_updates(self, io_components):

io_components = [
c()
for c in io_components
Expand Down Expand Up @@ -1284,7 +1281,6 @@ def test_raise_exception_if_parameters_invalid(self):

@pytest.mark.asyncio
async def test_every_does_not_block_queue(self):

with gr.Blocks() as demo:
num = gr.Number(value=0)
name = gr.Textbox()
Expand Down
2 changes: 0 additions & 2 deletions test/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,6 @@ def test_component_functions(self):
}

def test_color_argument(self):

label = gr.Label(value=-10, color="red")
assert label.get_config()["color"] == "red"
update_1 = gr.Label.update(value="bad", color="brown")
Expand Down Expand Up @@ -2182,7 +2181,6 @@ def test_dataset_calls_as_example(*mocks):
class TestScatterPlot:
@patch.dict("sys.modules", {"bokeh": MagicMock(__version__="3.0.3")})
def test_get_config(self):

assert gr.ScatterPlot().get_config() == {
"caption": None,
"elem_id": None,
Expand Down
1 change: 0 additions & 1 deletion test/test_networking.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def test_validation_error(self):


class TestStartServer:

# Test IPv4 and IPv6 hostnames as they would be passed from --server-name.
@pytest.mark.parametrize("host", ["127.0.0.1", "[::1]"])
def test_start_server(self, host):
Expand Down
3 changes: 0 additions & 3 deletions test/test_theme_sharing.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ def test_breaks_ties_against_prerelease(self):

class TestGetThemeAssets:
def test_get_theme_assets(self):

space_info = huggingface_hub.hf_api.SpaceInfo(
id="freddyaboulton/dracula",
siblings=[
Expand Down Expand Up @@ -285,7 +284,6 @@ def test_get_next_version(self, mock):

@pytest.mark.flaky
def test_theme_download(self):

assert (
gr.themes.Base.from_hub("gradio/dracula_test@0.0.1").to_dict()
== dracula.to_dict()
Expand All @@ -298,7 +296,6 @@ def test_theme_download(self):
assert demo.theme.name == "gradio/dracula_test"

def test_theme_download_raises_error_if_theme_does_not_exist(self):

with pytest.raises(
ValueError, match="The space freddyaboulton/nonexistent does not exist"
):
Expand Down

0 comments on commit 8242c06

Please sign in to comment.