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

Two non-flaky unit tests fail on windows #9848

Open
1 task done
freddyaboulton opened this issue Oct 25, 2024 · 3 comments
Open
1 task done

Two non-flaky unit tests fail on windows #9848

freddyaboulton opened this issue Oct 25, 2024 · 3 comments
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@freddyaboulton
Copy link
Collaborator

Describe the bug

image

https://github.com/gradio-app/gradio/actions/runs/11523815312/job/32082647025?pr=9790

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

Screenshot

No response

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Darwin
gradio version: 4.41.0
gradio_client version: 1.4.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
anyio: 4.4.0
fastapi: 0.112.0
ffmpy: 0.4.0
gradio-client==1.3.0 is not installed.
httpx: 0.27.0
huggingface-hub: 0.24.5
importlib-resources: 6.4.0
jinja2: 3.1.4
markupsafe: 2.1.5
matplotlib: 3.9.1.post1
numpy: 2.0.1
orjson: 3.10.7
packaging: 24.1
pandas: 2.2.2
pillow: 10.4.0
pydantic: 2.9.0
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.2
ruff: 0.4.1
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.3
typing-extensions: 4.12.2
urllib3: 2.2.2
uvicorn: 0.30.5
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.6.1
httpx: 0.27.0
huggingface-hub: 0.24.5
packaging: 24.1
typing-extensions: 4.12.2
websockets: 12.0

Severity

I can work around it

@freddyaboulton freddyaboulton added bug Something isn't working good first issue Good for newcomers labels Oct 25, 2024
@yuvaljacob
Copy link

Hello,

May I work on this issue?

@freddyaboulton
Copy link
Collaborator Author

Yes thank you @yuvaljacob !

@yuvaljacob
Copy link

@freddyaboulton hope you are doing well.

I have looked into the issues and already forked the repo and started fixing the tests.

As for the first test test (test_is_in_or_equal), when comparing paths such as "//foo/asd" with "/foo", the first argument with two backslashes doesn't return a true Windows path, so the comparison fails, as this is a Linux notated path anyways, I skipped the two tests with this kind of comparison with if not sys.platform.startswith("win")
(you will see that in the PR, just updating in case this is not OK)

As for the second test
class TestImage:
def test_component_functions(self, gradio_temp_dir)

We have img.path which is using a hardcoded Linux notation path
We also have gr.Image(type="filepath", image_mode=None), when getting the path of image from the object's preprocess method, the Python Path object is returning it with backslashes because it's running on Windows.

The question is, should the backslashes be turned into slashes on this test only in case the platform is Windows?

I don't want to touch other system components which can affect the functionality of gradio, thanks in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants