Implement path to make mesop work in Windows#415
Merged
Conversation
Codecov ReportAttention: Patch coverage is
|
davorrunje
approved these changes
Oct 16, 2024
davorrunje
suggested changes
Oct 16, 2024
davorrunje
left a comment
Contributor
There was a problem hiding this comment.
Let me check something first
Fix mesop in windows refactor
davorinrusevljan
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me.
|
|
||
|
|
||
| @contextmanager | ||
| def patch_os_and_str() -> Iterator[None]: |
Contributor
There was a problem hiding this comment.
Do we have to worry if 2 threads attempt to execute this at the same time? In that case the one that finishes first would possibly remove patch for the second one at too early stage.
But I am not sure if we could have 2 threads hitting this code at the same time.
davorrunje
approved these changes
Oct 18, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
MesopUIis not working inWindowswith weird error. Flask was complaining thatwakeup_component.js. After a short conversation with @davorinrusevljan, I have learnt about the patching we do for mesop. This patching is not working inWindows.I have investigated further and discovered a bug in
mesop.labs.web_component- https://github.com/google/mesop/blob/main/mesop/labs/web_component.py#L34-L35. Here a/is prepended to a path but this piece of code forgets the fact that the windows uses\instead of/.I have fixed it by introducing a patched function and using that patched function. Ideally this bug fix should be made at mesop repo itself but I don't want to wait till they make the fix as we have some potential Windows users.
Fixes #413
Type of change
Checklist