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

Fix custom component CLI unit tests #9495

Merged
merged 5 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .config/copy_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ def copy_js_code(root: str | pathlib.Path):
"component-test",
"core",
"spa",
"wasm",
"utils",
]
for entry in (pathlib.Path(root) / "js").iterdir():
if (
Expand Down Expand Up @@ -48,6 +46,12 @@ def ignore(s, names):
ignore=ignore,
dirs_exist_ok=True,
)
shutil.copytree(
str(pathlib.Path(root) / "client" / "js"),
str(pathlib.Path("gradio") / "_frontend_code" / "client"),
ignore=lambda d, names: ["node_modules", "test"],
dirs_exist_ok=True,
)


class BuildHook(BuildHookInterface):
Expand Down
2 changes: 2 additions & 0 deletions gradio/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ def __init__(
max_length: int | None = None,
waveform_options: WaveformOptions | dict | None = None,
loop: bool = False,
recording: bool = False,
):
sources = ["microphone"]
super().__init__(
Expand Down Expand Up @@ -496,6 +497,7 @@ def __init__(
max_length=max_length,
waveform_options=waveform_options,
loop=loop,
recording=recording,
)


Expand Down
2 changes: 2 additions & 0 deletions test/components/test_audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async def test_component_functions(self, gradio_temp_dir):
"proxy_url": None,
"type": "numpy",
"format": None,
"recording": False,
"streamable": False,
"max_length": None,
"min_length": None,
Expand Down Expand Up @@ -105,6 +106,7 @@ async def test_component_functions(self, gradio_temp_dir):
"container": True,
"editable": True,
"min_width": 160,
"recording": False,
"scale": None,
"elem_id": None,
"elem_classes": [],
Expand Down
Loading