-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: make the crawler runnable and testable on Windows #3830
fix: make the crawler runnable and testable on Windows #3830
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 👍 Great to cover the crawler with CI tests also on Windows. No change requests from my side. I just commented about pathlib's auto-handling of /
. I will merge this PR once main branch is green. Thank you for another contribution to Haystack @anakin87 ! 🎉
@@ -18,7 +18,7 @@ | |||
|
|||
@pytest.fixture(scope="session") | |||
def test_url(): | |||
return f"file://{SAMPLES_PATH.absolute()}/crawler" | |||
return (SAMPLES_PATH / "crawler").absolute().as_uri() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to have pathlib handling the /
for unix/windows automatically. 👍 Alternative would have been SAMPLES_PATH.joinpath("crawler").absolute().as_uri()
Related Issues
Proposed Changes:
haystack/haystack/nodes/connector/crawler.py
Line 104 in 5b0b338
In the
__init__
method of the crawler,os.geteuid()
is called.It only works on Linux.
On Windows, it raises an
AttributeError
.My hunch is that on Windows
IS_ROOT
can be set toFalse
without affecting the proper functioning of the crawler.How did you test it?
Since the tests don't properly work on Windows, I'm also changing them a bit
Checklist