This repository was archived by the owner on Dec 16, 2022. It is now read-only.
be friendlier to windows users #1572
Merged
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.
these are small things that prevent allennlp from running on windows, this isn't all the way to getting it to work, but it's a step in that direction:
(1) jsonnet won't pip install on windows right now, so I disabled it in
requirements.txt
if the platform is windows(2) accordingly, in
params.py
we wrap theimport _jsonnet
in a try-catch block, and if it can't be imported we stub in alternative functions that log a warning and assume the configuration is pure JSON(3) the
resource
module doesn't exist on Windows, so inutil.py
we import it conditionally, and then we check that it's there before we use it(4) on unix, urlparse.scheme is an empty string for a file, but on windows it isn't, so I just removed that check in
cached_path
, it should be fine to just check if the file exists whatever the scheme is