mirror of
https://github.com/gradio-app/gradio.git
synced 2025-02-23 11:39:17 +08:00
Upgrade black to 23.3 (#4259)
* Upgrade black * Conservatively upgrade packaging too since it's black's dependency
This commit is contained in:
parent
f353adf7a9
commit
9ece3b43b9
@ -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:
|
||||
|
||||
|
@ -610,7 +610,6 @@ class Endpoint:
|
||||
return self.__repr__()
|
||||
|
||||
def make_end_to_end_fn(self, helper: Communicator | None = None):
|
||||
|
||||
_predict = self.make_predict(helper)
|
||||
|
||||
def _inner(*data):
|
||||
|
@ -1,4 +1,4 @@
|
||||
black==22.6.0
|
||||
black==23.3.0
|
||||
pytest-asyncio
|
||||
pytest==7.1.2
|
||||
ruff==0.0.264
|
||||
|
@ -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:
|
||||
|
@ -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"}
|
||||
|
@ -616,7 +616,6 @@ class Interface(Blocks):
|
||||
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
|
||||
@ -885,7 +884,7 @@ class TabbedInterface(Blocks):
|
||||
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()
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
@ -121,7 +121,7 @@ numpy==1.21.6
|
||||
# shap
|
||||
# tifffile
|
||||
# transformers
|
||||
packaging==21.3
|
||||
packaging==22.0
|
||||
# via
|
||||
# huggingface-hub
|
||||
# pytest
|
||||
|
@ -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
|
||||
@ -111,7 +111,7 @@ numpy==1.21.6
|
||||
# shap
|
||||
# tifffile
|
||||
# transformers
|
||||
packaging==21.3
|
||||
packaging==22.0
|
||||
# via
|
||||
# huggingface-hub
|
||||
# pytest
|
||||
|
@ -358,7 +358,6 @@ class TestBlocksMethods:
|
||||
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)
|
||||
@ -375,7 +374,6 @@ class TestBlocksMethods:
|
||||
yield from range(10)
|
||||
|
||||
with gr.Blocks() as demo:
|
||||
|
||||
gr.Number(value=lambda: 2, every=2)
|
||||
meaning_of_life = gr.Number()
|
||||
counter = gr.Number()
|
||||
@ -524,7 +522,6 @@ class TestComponentsInBlocks:
|
||||
|
||||
class TestBlocksPostprocessing:
|
||||
def test_blocks_do_not_filter_none_values_from_updates(self, io_components):
|
||||
|
||||
io_components = [
|
||||
c()
|
||||
for c in io_components
|
||||
@ -1284,7 +1281,6 @@ class TestEvery:
|
||||
|
||||
@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()
|
||||
|
@ -1546,7 +1546,6 @@ class TestLabel:
|
||||
}
|
||||
|
||||
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")
|
||||
@ -2182,7 +2181,6 @@ simple = pd.DataFrame(
|
||||
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,
|
||||
|
@ -54,7 +54,6 @@ class TestInterfaceErrors:
|
||||
|
||||
|
||||
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):
|
||||
|
@ -205,7 +205,6 @@ class TestSemverMatch:
|
||||
|
||||
class TestGetThemeAssets:
|
||||
def test_get_theme_assets(self):
|
||||
|
||||
space_info = huggingface_hub.hf_api.SpaceInfo(
|
||||
id="freddyaboulton/dracula",
|
||||
siblings=[
|
||||
@ -285,7 +284,6 @@ class TestThemeUploadDownload:
|
||||
|
||||
@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()
|
||||
@ -298,7 +296,6 @@ class TestThemeUploadDownload:
|
||||
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"
|
||||
):
|
||||
|
Loading…
Reference in New Issue
Block a user